backtest_strategy
Backtest trading strategies on historical price data — SMA crossover, RSI mean reversion, momentum, or Bollinger breakout. Get return, Sharpe, Calmar, drawdown, win rate, equity curve, and buy-and-hold comparison.
Instructions
Deterministic backtest of SMA crossover, RSI mean reversion, momentum, or Bollinger breakout. Replaces 10+ individual calls.
Use when backtesting a trading strategy on price history. Strategies: sma_crossover (params: fast, slow), rsi_mean_reversion (params: period, oversold, overbought), momentum (params: lookback), bollinger_breakout (params: period, std). Provide prices, strategy name, params, initial_capital, commission_bps. Returns: total return, Sharpe, Calmar, max drawdown, number of trades, win rate, equity curve, vs buy-and-hold. PAID ONLY — no free tier.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | No | Strategy params. SMA: {fast,slow}. RSI: {period,oversold,overbought}. Momentum: {lookback}. Bollinger: {period,std}. | |
| prices | Yes | Price history (daily closes, oldest first) | |
| strategy | No | sma_crossover | rsi_mean_reversion | momentum | bollinger_breakout | sma_crossover |
| slippage_bps | No | One-way slippage in basis points | |
| commission_bps | No | Round-trip commission in basis points | |
| initial_capital | No | Starting capital |