Backtest

Simulating a trading strategy on historical data to estimate its performance before deploying real capital.

Definition

A backtest is the process of running a trading strategy on historical price and market data to evaluate its hypothetical past performance. It estimates metrics like win rate, average profit/loss, maximum drawdown, and Sharpe ratio without risking real capital. The quality of a backtest depends on accurate fee modeling, realistic fill assumptions, and avoiding look-ahead bias.

In practice

Predtools provides tools/fetch-klines.js to download historical Binance candlestick data for backtest input. A typical backtest replays past 5-minute windows, applies the bot's signal logic (e.g., price momentum threshold), simulates order fills at the best available price, and records the outcome against historical Polymarket resolution data. The main pitfall is overfitting: a strategy that looks excellent on historical data may have implicitly learned artifacts of that specific period. Validating on an out-of-sample holdout period before live deployment is essential.

Related