quant_backtest_method
Backtest a quantitative trading method using its own live signal logic bar by bar, applying realistic costs and returning performance stats for parameter validation.
Instructions
Backtest a registered method by replaying its own analyze() over history.
The engines execute the method's live signal logic bar by bar (no separate backtest implementation that could drift). Daily methods replay daily bars with next-open fills and method-specific exits; intraday methods replay each available 5m session (provider-capped to ~60 days); xs_momentum runs a monthly-rebalance portfolio. Costs applied one-way on entry and exit.
Args: params (BacktestInput): method_key, tickers, period, costs_bps, risk_pct, top_n, response_format.
Returns: str: stats (n_trades, win_rate, avg_r/expectancy, profit_factor, max_drawdown_pct, total_return_pct), in-sample/out-of-sample halves, and the last 10 trades. Treat results as PARAMETER VALIDATION, not a forecast — yfinance data is survivorship-prone and costs are estimates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |