How to Backtest a Trading Strategy — Without Lying to Yourself
Most traders "backtest" by scrolling through historical charts, mentally noting where they would have entered, and concluding their strategy works. Then they trade live and lose money for six months.
This isn't backtesting. It's hindsight bias dressed up as research. Real backtesting requires structure that prevents you from lying to yourself.
The two backtest modes
There are exactly two valid approaches:
1. Manual bar-by-bar replay
You walk through historical price action one candle at a time, with future candles hidden. At each candle you decide: take a trade or not? If yes, where's the stop, where's the target, what's the size? You record the result. Repeat 100+ times.
This is the only way to backtest discretionary strategies (chart pattern reading, price action, intraday discretion). It cannot be automated because the decisions aren't programmable.
2. Automated backtesting (Pine Script, Expert Advisors, Python)
You write code that defines exact entry/exit rules. The code runs against historical data. You get a result.
This is the only way to backtest mechanical strategies (fixed rule sets, indicator crossovers, algorithmic systems). It's not useful for discretionary trading because most chart patterns can't be coded precisely.
If you're using your eyes to make trades live, you have to use your eyes (with future hidden) to backtest.
The 5 biases that ruin most backtests
1. Look-ahead bias
You "see" the chart and think "yeah I would have taken this at the breakout." But you can see the next 50 candles. Of course you would have taken it. Hide the future or the test is worthless.
2. Survivorship bias
You only count the trades you "would have taken." You skip the ones that look ambiguous in retrospect. Live trading doesn't let you skip ambiguous setups — you have to decide in the moment.
3. Optimisation bias
You tweak the rules ("oh, if I just used a 10-EMA instead of 8, this would have worked") until the backtest looks great on the specific data set you tested. This is curve-fitting. The strategy will fail on new data.
4. Position sizing optimism
You assume perfect fills, no slippage, no commissions. Real markets give you 0.5–2 pip slippage on entries during normal conditions, 5–20 pips on news. Build that into your backtest or your real numbers will be 30% worse.
5. Time-period bias
You backtest 3 months of trending market and conclude your trend strategy works. Then you trade in a range and lose. Backtest across at least 12 months covering bull, bear, and sideways periods.
How to manual-backtest properly (step by step)
Step 1: Pick your dataset
- Choose 6–12 months of price data on the symbol you'll actually trade
- Pick the timeframe you'll actually trade on (1H, 15m, etc.)
- Make sure it includes mixed market conditions (trending + ranging)
Step 2: Hide the future
- Use a bar replay tool (TradingView Bar Replay or RB Trading's backtest replay)
- Set a starting bar — everything after is hidden until you click forward
- Each click reveals one new bar
Step 3: Apply your rules at each bar
- Does this candle complete a setup I would take?
- If yes: log entry, stop, target, position size BEFORE clicking forward
- Click forward bar by bar
- Record exit (TP hit, SL hit, manual exit, time-based)
Step 4: Log everything in a journal
Each backtest trade should have:
- Date, time, symbol, timeframe
- Setup name (must match your live trading taxonomy)
- Entry, SL, TP, position size
- Outcome (win, loss, break-even, R-multiple)
- Notes on context (session, news event, market regime)
Step 5: Calculate the real numbers
After 100+ trades:
- Win rate
- Average winner R-multiple
- Average loser R-multiple
- Max consecutive losses (this drives your psychological prep)
- Maximum drawdown of the equity curve
- Net R per trade
Step 6: Stress test
- Cut your win rate by 10% — does it still work?
- Add 30% more drawdown — could you handle it psychologically?
- Multiply your losing R by 1.2 (slippage) — still profitable?
If all three are still positive, you have a strategy worth paper-trading. If any of them break, you have a strategy that probably won't survive real markets.
How long does a real backtest take?
Roughly 3–8 hours of focused work to backtest 100 trades manually on a 1H timeframe. Most traders won't spend that. That's why most strategies fail — the work to validate them hasn't been done.
Compare: 3–8 hours of backtesting vs months of losing real money on an unvalidated strategy. The math is obvious.
What separates a good backtest from a great one
Good backtest: you log entries + exits and calculate net P&L.
Great backtest:
- Tags every trade with emotional state at entry (you didn't have one in the test, but you can imagine — "would I really have taken this on a Friday afternoon?")
- Tags every trade with market regime (trending bull, ranging, post-news)
- Reviews segmented win rate by setup × session × regime
- Includes "trades I almost took" with reasoning
- Calculates maximum consecutive losing streak (psychological prep)
This is exactly what a journal lets you do — and the same tags carry over to live trading, so you can compare your backtest performance vs live performance.
When automated backtesting matters
If your strategy is:
- Simple indicator-based (e.g., MA crossover, RSI mean-reversion)
- Mechanical with no discretion
- Going to be run as an EA or algorithm
Use Pine Script (TradingView) or MQL5 (MetaTrader). Both have decent strategy testers. Both have the same biases — be especially careful of optimisation bias by testing on out-of-sample data.
The funded-trader workflow
The serious workflow before risking a $200 challenge fee:
- 6+ hours of manual backtesting of the strategy you'll trade
- Minimum 100 trades logged in your journal as backtest entries
- Net positive R with stress tests passed (10% lower WR, 20% higher slippage)
- 2 weeks of paper-trading with the same setup
- Then pay the challenge fee
Most traders skip steps 1–4. That's the 70% fail rate.
RB Trading Pro Journal includes a full backtest replay engine — load any chart, set a start date, hide the future, click bar-by-bar, log every backtest trade with the same tags as your live trades. Free for 7 days. The traders who validate their strategy first pass challenges at 3× the rate of those who don't.
Stop guessing. Start tracking.
Free 7-day trial · Card required · Cancel anytime · Used by 7,000+ funded traders
Start Free Trial →