| id | einstein-research-backtest-engine |
| name | Einstein Research — Backtest Engine |
| description | Programmatic backtesting framework for trading strategies. Runs backtests with historical price data (yfinance or CSV), supports momentum/mean-reversion/factor/signal-based strategies, walk-forward optimization, out-of-sample testing, transaction cost modeling, regime-aware splits, and full performance metrics (Sharpe, Sortino, Calmar, max drawdown, CAGR, win rate, profit factor). Distinct from einstein-research-backtest (which provides methodology guidance). Use when a user wants to actually run a backtest, test a specific strategy on historical data, or generate performance metrics. |
| version | 1.0.0 |
| author | DaVinci |
| last_amended_at | null |
| trigger_patterns | [] |
| pre_conditions | {"git_repo_required":false,"tools_available":[]} |
| expected_output_format | natural_language |
Backtest Engine
This skill is the programmatic engine for running quantitative trading strategy backtests. It takes a machine-readable strategy definition (e.g., from the einstein-research-edge skill) and executes it against historical data, producing detailed performance metrics.
When to Use This Skill
- User wants to run a backtest on a specific strategy.
- User has a
strategy.yaml file from the edge-generator skill.
- User wants to generate performance metrics for a trading idea.
- Triggers: "run a backtest," "test this strategy," "generate performance metrics."
This skill is for execution. For guidance on how to design a robust backtest, see the einstein-research-backtest methodology skill.
Workflow
Step 1: Provide Strategy Definition
The backtest engine requires a strategy.yaml file that defines the rules of the strategy.
strategy.yaml Format:
version: backtest-engine/v1
name: 52-Week High Momentum
universe: "sp500"
data:
source: yfinance
start_date: "2018-01-01"
end_date: "2023-12-31"
entry_signal:
- "price > high_52w"
- "volume > 2 * avg_volume_50d"
exit_signal:
- "hold_days == 5"
- "pct_change >= 0.10"
- "pct_change <= -0.05"
parameters:
hold_days: 5