What is backtesting?

Backtesting simulates how a trading strategy would have performed on historical data. Learn the steps, common pitfalls like overfitting, and how to backtest systematically without writing code.

Published September 28, 20265 min readQuantly team

Backtesting is the practice of running a strategy's rules against historical market data to see how it would have traded in the past. It does not predict the future, but it is the fastest way to filter bad ideas before you risk capital.

What you need

  1. A clear strategy - when to buy, sell, size positions, and rebalance.
  2. Historical prices - daily (or finer) data for every symbol you trade.
  3. Realistic assumptions - fees, slippage, and tradable universes (no peeking at delisted stocks without handling survivorship).

The basic loop

  1. Define rules (for example, "hold top 3 momentum names each month").
  2. Walk forward through history bar by bar.
  3. Apply rules as if you were trading live on each date with only information available then.
  4. Record positions, cash, and equity over time.
  5. Summarize performance: return, volatility, Sharpe, max drawdown, hit rate.

Common mistakes

MistakeWhy it hurts
Look-ahead biasUsing future data in today's decision inflates results.
OverfittingTweaking until one date range looks perfect; fails live.
Ignoring costsSmall edges disappear after commissions and slippage.
Too little dataOne bull market is not a full stress test.

Backtest vs paper trading

A backtest is historical simulation. Paper trading runs the same logic forward in real time with simulated fills. The best workflow: backtest for research, paper trade for execution bugs and operational confidence, then consider live sizing.

No-code backtesting

Visual builders let you express conditions (indicators, filters, weights) without Python. The discipline is the same: state hypotheses, test out-of-sample periods, and change one variable at a time.

Quantly supports long-history backtests on many tickers, benchmark comparison, and Monte Carlo stress tests. Try the demo to walk through a full loop.

Ready to build

Your strategy deserves a real runtime

Paper trade in minutes. Backtest across decades of data. Connect your brokerage when you are ready to go live.