backtesting-trading-strategies

Featured

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Backtesting Trading Strategies ## Overview Validate trading strategies against historical data before risking real capital. This skill provides a complete backtesting framework with 8 built-in strategies, comprehensive performance metrics, and parameter optimization. **Key Features:** - 8 pre-built trading strategies (SMA, EMA, RSI, MACD, Bollinger, Breakout, Mean Reversion, Momentum) - Full performance metrics (Sharpe, Sortino, Calmar, VaR, max drawdown) - Parameter grid search optimization - Equity curve visualization - Trade-by-trade analysis ## Prerequisites Install required dependencies: ```bash set -euo pipefail pip install pandas numpy yfinance matplotlib ``` Optional for advanced features: ```bash set -euo pipefail pip install ta-lib scipy scikit-learn ``` ## Instructions 1. Fetch historical data (cached to `${CLAUDE_SKILL_DIR}/data/` for reuse): ```bash python ${CLAUDE_SKILL_DIR}/scripts/fetch_data.py --symbol BTC-USD --period 2y --interval 1d ``` 2. Run a backtest with default or custom parameters: ```bash python ${CLAUDE_SKILL_DIR}/scripts/backtest.py --strategy sma_crossover --symbol BTC-USD --period 1y python ${CLAUDE_SKILL_DIR}/scripts/backtest.py \ --strategy rsi_reversal \ --symbol ETH-USD \ --period 1y \ --capital 10000 \ # 10000: 10 seconds in ms --params '{"period": 14, "overbought": 70, "oversold": 30}' ``` 3. Analyze results saved to `${CLAUDE_SKILL_DIR}/reports/` -- includes `*_summary.txt` (perfo...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category