LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

backtesting-trading-strategies

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".

31stars6forksUpdated 7/5/2026
Data Science & ML#trading#quantitative-analysis#finance#python#backtesting

Security Assessment

Safe(100/100)
Security Score100/100

About backtesting-trading-strategies

A complete framework for backtesting crypto and traditional trading strategies against historical price data before any real capital is at risk. It fits requests to test or validate a strategy, check historical performance, simulate trades, optimize parameters, or compare approaches, and is triggered by phrases such as backtest strategy or validate signals. The workflow is script-driven in Python and organized around a small set of command-line entry points.

Eight strategies ship built in - SMA and EMA crossovers, RSI reversal, MACD, Bollinger Bands, breakout, mean reversion, and momentum - each exposing its own tunable parameters. A typical run fetches and caches historical data with fetch_data.py (sourced from Yahoo Finance via yfinance), runs a backtest with backtest.py using a chosen strategy, symbol, period, starting capital, and JSON parameters, then reviews the generated reports. Output artifacts include a text performance summary, a trade log CSV, an equity-curve CSV, and a rendered equity-curve chart. Parameter tuning is handled by optimize.py, which grid-searches across supplied parameter ranges to find the best-performing combination.

Reported results are thorough: performance metrics such as total return, CAGR, Sharpe, Sortino, and Calmar ratios; risk metrics including maximum drawdown, VaR, CVaR, and annualized volatility; and trade statistics like win rate, profit factor, and expectancy. Behavior is controlled through a settings.yaml file covering default capital, commission, slippage, and position sizing, with optional fixed stop-loss and take-profit. Core dependencies are pandas, numpy, yfinance, and matplotlib, with ta-lib, scipy, and scikit-learn available for advanced features. Reference files document error handling and worked examples including multi-asset comparison and walk-forward analysis, making it a self-contained toolkit for quantitatively validating trading ideas.

FAQ

Which strategies are built in?

Eight: sma_crossover, ema_crossover, rsi_reversal, macd, bollinger_bands, breakout, mean_reversion, and momentum, each with its own key parameters.

What dependencies does it need?

It requires pandas, numpy, yfinance, and matplotlib, with ta-lib, scipy, and scikit-learn listed as optional installs for advanced features.

How do I find the best parameters for a strategy?

Run optimize.py with a param-grid of value ranges (for example fast and slow periods); it performs a grid search to identify the optimal combination.

What performance and risk metrics does it report?

Performance metrics include total return, CAGR, Sharpe, Sortino, and Calmar; risk metrics include max drawdown, VaR, CVaR, and volatility; trade stats include win rate, profit factor, and expectancy.

Where does the historical data come from?

Data is pulled from Yahoo Finance through the yfinance library by fetch_data.py and cached to a CSV per symbol and interval for reuse.

All Files

10 files
references/errors.md3.7 KB
View
scripts/metrics.py11.4 KB
View
scripts/backtest.py11.2 KB
View
SKILL.md6.2 KB
View
references/examples.md4.4 KB
View
scripts/optimize.py6.2 KB
View
config/settings.yaml1.4 KB
View
scripts/fetch_data.py4.7 KB
View
references/implementation.md4.1 KB
View
scripts/strategies.py10.5 KB
View

Install backtesting-trading-strategies

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

gracefullight/stock-checker

Related Skills

dbt-sf-to-bq-translator

21,076

build-models

102

html-prototype

3,588

doc

448