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

Never trade a strategy without backtesting it first.

I learned this lesson the expensive way. Early in my trading career, I read about a "proven" strategy online. It looked solid. Made sense. So I started trading it live with real money.

Three weeks later, I'd lost 15% of my account.

The strategy wasn't bad—it just wasn't right for my markets, my timeframe, or my personality. If I'd spent a few hours backtesting first, I would have known. Instead, I paid tuition to the market.

Backtesting is how you validate a strategy before risking real capital. It's how you build confidence in your edge. And it's saved me from countless bad ideas over the years.

Today I'm walking you through my exact backtesting process.

What is Backtesting?

Backtesting means testing your strategy on historical data to see how it would have performed.

You take your rules—your entry criteria, your stop loss, your target—and you apply them to past charts. You see what would have happened if you'd traded that way.

Did the strategy produce winners? What was the win rate? What was the average gain versus average loss? How bad were the drawdowns?

Important caveat: Backtesting isn't a crystal ball. Past performance doesn't guarantee future results. Markets change. But if a strategy doesn't work on historical data, it almost certainly won't work going forward.

Think of backtesting as the minimum bar. If it can't pass this test, don't trade it.

Manual vs. automated backtesting:

Automated backtesting uses code to apply your rules to historical data instantly. It's fast and can test thousands of trades in seconds.

Manual backtesting means you go through charts bar by bar, identifying setups and recording results by hand. It's slower but teaches you more.

I primarily use manual backtesting for discretionary trading. Here's why: my A+ setup system involves judgment calls that are hard to automate. Is the price action "clean"? Is the volume confirmation "strong"? These are subjective criteria.

Manual backtesting forces me to develop the pattern recognition skills I need for live trading.

Manual Backtesting: Tim's Method

Here's my step-by-step process.

Step 1: Define Your Strategy Rules Clearly

Before you start, write down your rules in explicit detail. Vague rules lead to vague results.

Bad: "Buy at support." Good: "Buy when price reaches a horizontal support level that has been tested at least twice before, and a bullish engulfing candle forms with volume at least 20% above the 20-day average."

Every rule needs to be specific enough that someone else could follow it and get the same results.

For my backtests, I use my A+ grading criteria: 1. Clear trend direction 2. Strong support/resistance level 3. Multiple confirmations 4. Risk/reward minimum 2:1 5. Volume confirmation 6. Clean price action

If a setup meets all six, I mark it as a trade. If it doesn't, I skip it.

Step 2: Choose Your Market and Timeframe

Select one market (Bitcoin, SPY, etc.) and one timeframe (daily, 4-hour, etc.) to test.

Don't try to backtest multiple markets simultaneously. You want clean data for one specific application.

I recommend starting with the market you actually plan to trade. If you're a crypto trader, backtest on crypto. If you trade stocks, use stocks.

Step 3: Select Your Testing Period

You need enough data to generate statistically significant results. For swing trading on daily charts, I recommend at least two years of data—ideally including both bull and bear market conditions.

Why? Because a strategy that works only in bull markets isn't a strategy. It's luck.

Make sure your testing period includes: - Trending markets (up and down) - Choppy, sideways markets - Volatile periods - Quiet periods

You want to see how the strategy performs across different conditions.

Step 4: Go Bar by Bar

Here's where the actual work happens.

Using TradingView's replay feature (or just scrolling through historical charts), start at the beginning of your testing period. Advance one candle at a time.

At each candle, ask: "Do my rules say to enter a trade here?"

If yes, mark the entry. Note the price. Determine your stop loss and target based on your rules.

If no, advance to the next candle.

Critical rule: Don't look ahead. The point is to simulate what you would have seen in real-time. If you peek at the future and adjust your decisions, you're cheating—and your results will be meaningless.

Step 5: Record Every Trade

For each trade, log: - Entry date and price - Stop loss price - Target price - Risk/reward ratio - Exit date and price - Result (win/loss) - R multiple (how many R you gained or lost)

I use a simple spreadsheet. Columns for each variable. One row per trade.

Don't skip trades that look like losers. Don't add trades that you wouldn't have seen in real-time. Record everything honestly.

Step 6: Advance to See Outcome

After marking your entry, stop, and target, advance the chart to see what happened.

Did price hit your stop first, or your target? Mark the result.

If your system uses trailing stops or partial profits, track those too.

Step 7: Repeat for 100+ Trades

One trade proves nothing. Ten trades are barely meaningful. You need at least 100 trades to have statistically significant results.

Yes, this takes time. For a swing trading strategy on daily charts, finding 100 setups might require going back 2-3 years.

Do the work. It's worth it.

Step 8: Calculate Your Statistics

Once you have your trade log, calculate:

Win rate: Winning trades ÷ Total trades

Average R on wins: Sum of winning R ÷ Number of wins

Average R on losses: Sum of losing R ÷ Number of losses

Expectancy: (Win rate × Average win) – (Loss rate × Average loss)

Maximum drawdown: The worst peak-to-trough decline during the testing period

Expectancy is the key number. It tells you how much you expect to make per trade, on average. If expectancy is positive, the strategy has edge. If it's negative, it's losing money over time.

Example calculation: - 100 trades - 55 winners (55% win rate) - Average win: 2.1R - Average loss: 1.0R - Expectancy = (0.55 × 2.1) – (0.45 × 1.0) = 1.155 – 0.45 = 0.705R per trade

That means every trade, on average, makes 0.705R. That's a profitable strategy.

How I Backtested My A+ Setup System

Let me share how I validated my own approach.

When I developed the A+ grading criteria, I didn't just start trading it. I went back through two years of Bitcoin charts on the daily and 4-hour timeframes.

Every time I saw a potential setup, I ran through my checklist. If it graded A+, I marked it as a trade. B or lower, I passed.

After three weeks of work (yes, manual backtesting is time-consuming), I had 127 trades logged.

Results: - Win rate: 61% - Average winner: 2.3R - Average loser: 0.9R - Expectancy: 0.75R per trade - Maximum drawdown: 8 losing trades in a row

Those numbers gave me confidence. I knew the system worked historically. I knew what a losing streak might look like. I was mentally prepared.

When I started trading live, I wasn't hoping it would work. I knew the probabilities were in my favor.

Common Backtesting Mistakes

Mistake #1: Cherry-Picking Winners

It's tempting to unconsciously select the trades that worked and skip the ones that didn't. You look at a setup, see that it lost, and decide "well, I probably wouldn't have taken that one."

Yes, you would have. That's why you need explicit rules.

The fix: Be mechanical. If your rules say trade, you record it as a trade. Period. Don't use hindsight to filter.

Mistake #2: Not Accounting for Slippage and Commissions

Your backtest assumes perfect execution. In reality, you'll experience slippage (getting filled at a slightly worse price) and pay commissions.

The fix: Subtract a small amount (0.1-0.2%) from each trade to account for execution costs. Better to underestimate performance than overestimate.

Mistake #3: Changing Rules Mid-Test

You start testing with one set of rules. Halfway through, you notice something and decide to "improve" the rules. Now you're testing a different strategy.

The fix: Finish the test with your original rules. Then start a new test with modified rules. Don't mix them.

Mistake #4: Overfitting

Overfitting means making your strategy too specific to past data. If you require "bullish engulfing candles that form on Tuesdays when RSI is between 42 and 47," you've probably overfitted.

Overfit strategies look amazing in backtests but fail in live trading because the specific conditions rarely repeat.

The fix: Keep rules simple and logical. If a rule doesn't make intuitive sense, it's probably curve fitting.

Mistake #5: Insufficient Sample Size

You test 25 trades, get a 68% win rate, and declare victory.

But 25 trades is statistically meaningless. You could have gotten that result by chance.

The fix: Minimum 100 trades. Preferably more. The more trades you have, the more confident you can be in the results.

My Confession

I'll admit something: my first backtest was garbage.

I didn't have clear rules. I was kind of eyeballing setups. When I saw a losing trade developing, I'd decide "I wouldn't have taken that one." I ended my backtest with an 80% win rate.

Then I started trading live and promptly lost money.

I'd cheated myself. The backtest told me what I wanted to hear, not what was true.

When I got serious and did an honest backtest with clear rules, my win rate dropped to 61%. But that number was real. And 61% with good risk/reward is plenty profitable.

Honest backtesting changed everything.

When to Start Live Trading

You've completed your backtest. When are you ready to trade live?

Minimum criteria: - At least 100 trades tested - Positive expectancy (ideally 0.3R per trade or better) - Win rate above 50% OR average winner at least 2x average loser - Maximum drawdown you can emotionally handle

If your backtest shows these characteristics, you have statistical evidence of edge.

But start small. I recommend trading at 1/4 of your intended position size for the first 20-30 trades. This confirms that your live execution matches your backtest assumptions.

Only after those 20-30 trades confirm your edge should you scale to full position size.

Putting It All Together

Backtesting isn't sexy. It's not the dopamine hit of watching live trades. But it's the foundation of professional trading.

Here's the process in summary:

  1. Define your rules clearly — No ambiguity
  2. Select market and timeframe — One at a time
  3. Choose testing period — Multiple market conditions
  4. Go bar by bar — Don't look ahead
  5. Record every trade — Wins and losses
  6. Calculate statistics — Especially expectancy
  7. Be honest — No cherry-picking or rule changes
  8. Require 100+ trades — Statistical significance
  9. Start live trading small — Validate before scaling

Want to skip the backtesting work? The Complete TW Trading System course includes strategies that have already been thoroughly backtested. You'll see the historical data and understand the edge before you trade.

But even then, I recommend doing your own backtesting. Going through the process teaches you things that no course can.

For tracking your live trades once you start, use our journal template. And always size positions properly with our position calculator.

Backtesting is your safety net. It's how you build confidence in your edge before real money is on the line. Do the work now so you can trade with conviction later.


Trading involves substantial risk. This is educational content only. Past performance in backtesting does not guarantee future live trading results.