Agent skill · data analytics · jeremylongshore
backtesting-trading-strategies
Backtest crypto and traditional trading strategies against historical
Why this skill is useful
Adds executable scripts for backtesting trading strategies with performance metrics and parameter optimization that aren't available in public documentation.
What it needs
Requires matplotlib, numpy, pandas, yfinance installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
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: Optional for advanced features: Instructions 1. Fetch historical data (cached to ${CLAUDESKILLDIR}/data/ for reuse): 2. Run a backtest with default or custom parameters: 3. Analyze results saved to ${CLAUDESKILLDIR}/reports/ -- includes summary.txt (performance metrics), trades.csv (trade log), equity.csv (equity curve data), and chart.png (visual equity curve). 4. Optimize parameters via grid search to find the best combination: Output Performance Metrics Metric Description -------- ------------- Total Return Overall percentage gain/loss CAGR Compound annual growth rate Sharpe Ratio Risk-adjusted return (target: >1.5) Sortino Ratio Downside risk-adjusted return Calmar Ratio Return divided by max drawdown Risk Metrics Metric Description -------- ------------- Max Drawdown Largest peak-to-trough decline VaR (95%) Value at Risk at 95% confidence CVaR (95%) Expected loss beyond VaR Volatility Annualized standard deviation Trade Statistics Metric Description -------- ------------- Total Trades Number of round-trip trades Win Rate Percentage of profitable trades Profit Factor Gross profit divided by gross loss Expectancy Expected value per trade Example Output Supported Strategies Strategy Description Key Parameters ---------- ------------- ---------------- smacrossover Simple moving average crossover fastperiod, slowperiod emacrossover Exponential MA crossover fastperiod, slowperiod rsireversal RSI ov …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/backtesting-trading-strategies--f42578