Skip to content

garroshub/backtesting-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backtesting Skill

Hero banner

AI Agents Built on Zipline Schema Driven MIT License

An AI-native backtesting skill for fast strategy idea evaluation. It provides a schema-driven workflow for AI agents and runs on top of Zipline.

Why This Exists

  • Fast idea-to-backtest flow for AI agents
  • Reproducible runs from constrained JSON schema
  • Structured diagnostics beyond raw return metrics

This project is not a full portfolio optimization platform.

Value cards

How It Works

Pipeline

Install as an Agent Skill (npx)

Install from GitHub (project-local):

npx skills add https://github.com/garroshub/backtesting-skill -a opencode -y

Verify the skill is installed:

npx skills list -a opencode

Optional checks and alternatives:

# Show available skills in this repo without installing
npx skills add https://github.com/garroshub/backtesting-skill --list

# Global install
npx skills add https://github.com/garroshub/backtesting-skill -g -a opencode -y

# Legacy alias (deprecated)
npx add-skill garroshub/backtesting-skill

Quick Start

Python 3.11+ is recommended.

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Validate a schema:

python scripts/run_backtest_from_schema.py --schema references/example_trend_dip_single_schema.json --validate-only

Run a single backtest:

python scripts/run_backtest_from_schema.py --schema references/example_trend_dip_single_schema.json

Run a grid search:

python scripts/run_backtest_from_schema.py --schema references/example_trend_dip_grid_schema.json

If bundle data is missing and schema allows it:

python scripts/run_backtest_from_schema.py --schema references/example_trend_dip_grid_schema.json --ingest-if-missing

Output Preview

Output preview

Primary output blocks include:

  • metrics
  • performance_metrics
  • trade_summary
  • capacity_diagnostics
  • risk_attribution
  • practical_assessment

Grid mode adds:

  • top_results
  • stability_diagnostics

Data and live interface

Supported Templates

  • oversold_bounce_long_only
  • sma_crossover_long_only
  • trend_dip_buy_long_only

Multi-symbol equal-weight mode is available for:

  • sma_crossover_long_only
  • trend_dip_buy_long_only

oversold_bounce_long_only remains single-symbol strategy logic.

Data and Live Interface

  • Active runtime data source: data.source = "bundle"
  • Reserved data interfaces: csv, parquet, custom (replaceable by design)
  • Reserved live interface: live_data (for example ibkr) is validation-only and not production live trading

See references/schema.md for complete fields and output contract.

Star History

Star History Chart

Project Layout

  • SKILL.md: skill behavior and workflow
  • references/schema.md: schema and output reference
  • references/example_*.json: runnable examples
  • scripts/run_backtest_from_schema.py: runner
  • scripts/ingest_yahoo_bundle.py: optional ingestion helper

License

MIT. See LICENSE.

About

AI-native schema-driven backtesting skill for fast strategy idea evaluation, built on Zipline.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages