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,944 stars 440 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
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

crypto-backtest

Strategy Backtester for crypto. Tests a simple entry rule (breakout, EMA cross, RSI) with an ATR stop and an R-multiple target on past candles, fees included, and reports the number of trades, win rate, expectancy in R, profit factor, max drawdown, longest losing streak and whether the first and second half of the data agree. Use before trading a rule with real money, or when the user says "backtest", "does this strategy work", "test my strategy", "what win rate", "جرب الاستراتيجية", "اختبر الطريقة", "هل تربح".

0 Updated 1 weeks ago
devfn93
Testing & QA Listed

crypto-backtest

Strategy Backtester for crypto. Tests a simple entry rule (breakout, EMA cross, RSI) with an ATR stop and an R-multiple target on past candles, fees included, and reports the number of trades, win rate, expectancy in R, profit factor, max drawdown, longest losing streak and whether the first and second half of the data agree. Use before trading a rule with real money, or when the user says "backtest", "does this strategy work", "test my strategy", "what win rate", "جرب الاستراتيجية", "اختبر الطريقة", "هل تربح".

0 Updated 1 weeks ago
devfn93
Testing & QA Listed

trading-backtest

Backtest trading strategies written as simple rules on one or many symbols in any market - next-bar-open execution with no look-ahead, commissions and slippage, ATR/percent/rule-based stops, R or percent targets, trailing stops, time exits, risk-based position sizing, max concurrent positions with ranking, benchmark comparison, in-sample vs out-of-sample split and a self-contained HTML report. Use when the user asks "does this strategy work", "backtest X", "test a moving-average crossover", "what if I bought when RSI was below 30", or wants to validate an idea before trading it.

7 Updated 1 weeks ago
reddygopalkrishna