gracefullight avatar

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-code

Installs 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

More from gracefullight/stock-checker

All 8
1k-dense-ai avatargtarsk-dense-ai/scientific-agent-skillsUse Gtars for local genomic interval models and set algebra, overlaps and counts, consensus and coverage, tokenization, fragment processing, and refget/BEDbase 2Kskills.sh installs
2k-dense-ai avatarpolars-biok-dense-ai/scientific-agent-skillsHigh-performance genomic interval operations and bioinformatics file I/O on Polars DataFrames. Overlap, nearest, merge, coverage, complement, subtract for BED/V2Kskills.sh installs
3onmax avatarts-libraryonmax/nuxt-skillsUse when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling (tsdown/unbuild), API design patterns, type 2Kskills.sh installs
4nashsu avatarautoclinashsu/autocli-skillUse autocli CLI to interact with 55+ social/content websites (HackerNews, Reddit, Twitter/X, Bilibili, Zhihu, Weibo, Xiaohongshu, YouTube, Medium, Substack, Dou2Kskills.sh installs
5minimax-ai avatarreact-native-devminimax-ai/skillsReact Native and Expo development guide covering components, styling, animations, navigation, state management, forms, networking, performance optimization, tes1.9Kskills.sh installs
6nvidia avatarnemo-rl-auto-researchnvidia/skillsAutonomous NeMo-RL research agent workflow for directed hypothesis testing and open-ended discovery. Guides agents through the full experiment lifecycle: unders1.9Kskills.sh installs