Backtesting

How to Backtest a Trading Strategy (Step-by-Step)

๐Ÿ“… May 25, 2026 โฑ 10 min read ๐Ÿ‘ค TradeLens Team

Every profitable trader has one thing in common: they tested their strategy before risking real money on it.

Most retail traders skip this step. They watch a YouTube video, see a "strategy" with a few cherry-picked wins, and load up real capital. Then they blow their account and blame the market.

Here's how to actually backtest โ€” properly, honestly, and in a way that tells you if your edge is real.

What "backtesting" actually means

Backtesting means manually (or automatically) running your strategy through historical price data to see how it would have performed.

Done right, it tells you:

Done wrong, backtesting just convinces you a losing strategy will work and gets you into bigger trouble.

The 7-step backtesting process

Step 1 โ€” Write your strategy down. ALL of it.

If you can't write it down, you don't have a strategy โ€” you have a feeling.

Be specific. "Buy when it looks bullish" is not a strategy. "Buy when the 50 EMA crosses above the 200 EMA on the 4H chart, with RSI above 50, with stop loss at the swing low and TP at 2R" is a strategy.

Your written strategy needs:

Step 2 โ€” Pick a market and timeframe

Pick ONE market (e.g., EURUSD, BTC, SPY) and ONE timeframe (e.g., 1H, 4H, daily). Don't mix.

Why? Strategies that work on EURUSD might fail on Gold. What works on 5-minute charts might fail on daily. You need to know what your edge actually is, not blend together five different things.

Step 3 โ€” Choose a long sample period

Minimum: 6 months of price action. Better: 1-2 years. Best: include both trending and ranging conditions.

Why? A strategy that "worked" through May-July 2025 might have been pure luck. Test through volatile periods, ranging periods, news events, and quiet periods. Real strategies hold up across regimes.

Step 4 โ€” Find setups bar by bar

Scroll through your chart from the start of your sample period. When your strategy says "enter," mark that bar. Use TradingView's replay feature so you don't see future bars while testing.

Hindsight bias warning: The #1 mistake in manual backtesting is looking at a chart, seeing the move that already happened, and going "yeah, I would have taken that." You wouldn't have. Use the bar-by-bar replay or you're just lying to yourself.

Step 5 โ€” Log every trade

For each setup, log:

This is exactly what TradeLens does โ€” you can enter the R:R outcome (like +2 or -1) and it tracks everything for you.

Step 6 โ€” Aim for at least 30 trades (50+ is better)

Fewer than 30 trades and your sample is too small. You could have a 90% win rate over 10 trades and still be unprofitable in the long run because you got lucky.

50-100 trades gives you statistically meaningful data. Anything below 20 is just noise.

Step 7 โ€” Calculate your metrics

After logging your sample, calculate:

MetricWhat to look for
Win RateRealistic for your R:R (see our win rate guide)
Profit Factor1.5+ minimum to trade live
ExpectancyPositive, ideally +0.3R or higher
Max DrawdownCould you handle this with real money?
Average R:R1.5+ minimum

The brutal honesty check

After backtesting, ask yourself:

  1. Would I take EVERY one of these setups live? If not, you're cherry-picking and your live performance will be worse.
  2. Could I survive the max drawdown emotionally? If max DD was 25% of your test account, you WILL panic when real money hits that level.
  3. Did I see at least 30 trades? If not, keep going.
  4. Does it work in different conditions? Strategies that only work in trending markets WILL fail when markets range.

Common backtesting mistakes

What to do AFTER backtesting

If your strategy passed:

  1. Forward-test it on a demo account for 30+ trades
  2. Then go live with the SMALLEST possible position size
  3. After 50 live trades, compare your live stats to your backtest stats. If they match within 20%, scale up

If they don't match โ€” your backtest had a flaw. Find it before risking more.

TradeLens makes backtesting easy: log each trade as you go through historical data, see your live stats update, export your full backtest as a PDF report. No spreadsheet needed.

TL;DR: Backtesting properly = write your strategy down, pick one market and timeframe, replay bar-by-bar, log every single trade, get to 30+ trades, then check profit factor, expectancy, and max drawdown. Skip this step and you're gambling.
๐Ÿ“ค Share this post:

Ready to track your own trades?

TradeLens is a free trading backtest journal with built-in metrics and AI chart analysis.

Open the dashboard โ†’