
Backtesting Trading Strategies
Before you risk real money on that trading idea, run it through historical data with this backtesting framework. It comes with eight prebuilt strategies (SMA crossover, RSI reversal, MACD, Bollinger bands, etc.) and calculates the metrics that actually matter: Sharpe ratio, max drawdown, win rate, profit factor. The parameter optimization via grid search is handy for finding better configurations without manual trial and error. Built on yfinance for data fetching, so you can test against both crypto and traditional assets. The equity curve visualization and trade-by-trade logs make it easy to see where your strategy breaks down. Solid starting point if you're tired of backtesting strategies in spreadsheets.
- skills.sh installs
- 2K
- GitHub stars
- 49
- last updated
- Aug 21, 2026
Install
$ npx -y skills add gracefullight/stock-checker --skill backtesting-trading-strategies --agent claude-codeInstalls into .claude/skills of the current project.
Files
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:
pip install pandas numpy yfinance matplotlib
Optional for advanced features:
pip install ta-lib scipy scikit-learn
Instructions
Step 1: Fetch Historical Data
python {baseDir}/scripts/fetch_data.py --symbol BTC-USD --period 2y --interval 1d
Data is cached to {baseDir}/data/{symbol}_{interval}.csv for reuse.
Step 2: Run Backtest
Basic backtest with default parameters:
python {baseDir}/scripts/backtest.py --strategy sma_crossover --symbol BTC-USD --period 1y
Advanced backtest with custom parameters:
Sponsors
Details
- Repository
- github.com/gracefullight/stock-checker
- Categories
- Testing & QA, Debugging, Finance & Trading
- First seen
- May 16, 2026