backtest
Evaluate trading strategies by running backtests with natural language or structured rules, supporting walk-forward validation and risk-based position sizing.
Instructions
Run a backtest on a trading strategy using natural language or structured rules.
Args: strategy: Strategy description (e.g. "Buy when RSI(14) < 30, sell when RSI(14) > 70") or JSON structured format {"entries":[...],"exits":[...]} universe: List of tickers (e.g. ["AAPL", "MSFT"]) or preset ("SP500", "MAGNIFICENT7"). Defaults to MAGNIFICENT7. period_start: Start date YYYY-MM-DD (default: 3 years ago) period_end: End date YYYY-MM-DD (default: today) capital: Starting capital (default: 100000) benchmark: Benchmark ticker (default: SPY) walk_forward: Enable walk-forward validation to detect overfitting position_sizing: "equal", "risk_parity", "vol_target", or "kelly" allow_short: Allow short selling
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strategy | Yes | ||
| universe | No | ||
| period_start | No | ||
| period_end | No | ||
| capital | No | ||
| benchmark | No | SPY | |
| walk_forward | No | ||
| position_sizing | No | equal | |
| allow_short | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |