Guide

How to backtest a trading strategy

A backtest replays an exact rule set against historical candles to see what would have happened. Done honestly, it tells you whether a strategy has a measurable edge before you risk a cent. Done carelessly, it tells you a flattering lie. This guide is the honest version — the same execution assumptions Backtestify enforces on every run.

  1. Step 1

    Define exact rules — no ambiguity

    Write down every rule before looking at any result: the entry conditions, the stop loss, the take profit or exit signal, position size, and the market and timeframe. If a rule is vague ("buy on momentum"), the backtest cannot test it. Concrete: "Buy when RSI(14) crosses above 30 on the daily close, risk 1% per trade, stop at 2× ATR(14)."

  2. Step 2

    Choose the market, timeframe and budget

    Pick the instrument (for example BTC/USDT spot), the candle timeframe (1 minute to 1 week), the date window, and the starting budget. The timeframe changes everything — the same rules can win on 4h and lose on 15m.

  3. Step 3

    Replay candles with honest fills

    Replay the rules bar by bar on historical candles. The execution assumptions matter more than the rules: a signal only counts on a completed candle, the fill happens at the next candle's open, and if one candle touches both the stop and the target, count it as the stop. Anything else invents fills the market never offered.

  4. Step 4

    Charge real costs on both sides

    Deduct commission and slippage on entry and on exit. A strategy with a 0.2% average edge per trade is not a strategy once it pays 0.15% per side. Skipping costs is the most common way backtests lie.

  5. Step 5

    Validate on unseen data

    If you searched or tuned parameters on part of the history, re-measure the final rules on a withheld window that was never used to pick them. A result only on the data that produced it is a description of the past, not evidence of an edge.

  6. Step 6

    Read the risk report, not just the return

    Judge the test on win rate, profit factor, max drawdown, average result per trade, and the number of trades. Compare the return against simply buying and holding the same asset over the same window. Small samples prove nothing — a handful of lucky trades is not a strategy.

Common mistakes

Why most backtests lie

Lookahead bias

Using information from the same candle to trade that candle. Signal confirms on the close; the fill is the next open.

Survivorship of exits

Assuming the target fills when the stop was touched first on the same bar. Resolve adverse-first.

Zero-cost fantasy

Ignoring commission and slippage. Charge both sides, every trade.

Overfitting

Tuning parameters until the curve looks good, then reporting that same data. Always keep an unseen window.

Small samples

Drawing conclusions from a dozen trades. Edge needs a sample large enough to be meaningful.

The automated way

Do it in one sentence

Backtestify does this whole workflow for you. Describe the strategy in plain English — it is turned into an exact rule set, replayed on real candles with signal confirmation on the close, fills at the next open, and costs on both sides. You get a verdict with win rate, drawdown, profit factor, buy-and-hold beside your return, and a TradingView strategy you can verify.

Backtestify is a research tool, not financial advice. Every backtest is a hypothetical simulation of past data — past performance never guarantees future results.