What Backtesting Actually Is (And Isn't)

Backtesting is the process of applying your trading strategy to historical price data to see how it would have performed in the past. It's not a crystal ball. Past performance doesn't guarantee future results. But it does tell you whether your strategy has a logical edge, what kind of drawdowns to expect, and whether the returns are worth the risk. Without backtesting, you're trading on faith. With it, you're trading on evidence.

There are two types of backtesting: automated and manual. Automated backtesting uses code to apply your rules to thousands of data points instantly. Manual backtesting involves scrolling through historical charts and recording what your strategy would have done at each point. Both have value, but for most retail traders, manual backtesting is more practical and often more educational because it forces you to interact with price action the same way you would in live trading.

Step 1: Define Your Strategy Rules Precisely

Before you touch a chart, write down your strategy rules in explicit, unambiguous language. Your entry rule should be specific enough that two different people looking at the same chart would make the same decision. "Buy when the stock looks strong" fails this test. "Buy when the 20-day moving average crosses above the 50-day moving average and RSI is above 50" passes it.

Define every component: entry trigger, stop loss placement, profit target, position sizing, and any filters (time of day, market conditions, volume requirements). If your strategy has discretionary elements ("I'll use my judgment"), try to quantify them. Backtesting requires consistency, and discretionary decisions change every time you look at a chart.

Write these rules on a separate piece of paper or document and keep it visible while you backtest. The temptation to adjust your rules mid-test is strong, and it corrupts your results.

Step 2: Choose Your Data and Timeframe

Select the market, instrument, and timeframe you want to test. If your strategy is for the daily chart on large-cap US stocks, pull up daily charts of stocks you actually plan to trade. Avoid testing on assets you'll never trade because different instruments have different characteristics (volatility, liquidity, spread behavior).

You need enough historical data to generate a meaningful sample. Thirty trades is a bare minimum. Fifty to one hundred is better. One hundred or more gives you statistical confidence. For a daily chart swing trading strategy that triggers two to three times per month, you'll need at least a year of data, preferably two to three years.

Include different market conditions in your test period. A strategy that only works in a bull market will get crushed in a bear market or sideways chop. Make sure your data includes at least one period of each: trending up, trending down, and range-bound.

Step 3: The Manual Backtesting Process

Open your charting software and scroll to the beginning of your test period. Hide everything to the right of your starting point. Some platforms have a "replay" feature that lets you step forward one bar at a time, which is ideal. If your platform doesn't have this, you can cover the right side of the chart with a piece of paper or use the scroll bar carefully.

Step forward one bar at a time. At each bar, ask yourself: does my strategy generate a signal here? If yes, record the trade: entry price, stop loss level, target level, direction (long or short), and the date. Then continue stepping forward until the trade hits either your stop or your target. Record the result.

Use a spreadsheet to log every trade. Columns should include: date, instrument, direction, entry price, stop price, target price, exit price, result (win/loss), R-multiple (how many times your initial risk you made or lost), and notes. This spreadsheet becomes your backtest record and the source for all your performance metrics.

Step 4: What to Measure

After completing your backtest, calculate these key metrics from your spreadsheet. Win rate: the percentage of trades that were profitable. Average R-multiple: the average return per trade expressed as a multiple of risk. Profit factor: gross profits divided by gross losses (anything above 1.5 is solid). Maximum drawdown: the largest peak-to-trough decline in your equity curve. Average holding period: how long the typical trade lasted.

The most important number is expectancy, which tells you how much you expect to make per dollar risked. The formula is: (win rate times average win) minus (loss rate times average loss). If your expectancy is positive, your strategy has an edge. If it's negative, the strategy loses money over time regardless of individual winning trades.

Compare your results to a benchmark. If your strategy returns 15% annually with a 20% drawdown, is that better than simply buying and holding the S&P 500? If not, the complexity isn't worth it.

Common Manual Backtesting Mistakes

Peeking ahead is the most common mistake. When you know what happens next on the chart, your brain unconsciously adjusts your decisions. This is why the "hide future bars" approach is critical. If you catch yourself peeking, restart the test from that point.

Confirmation bias is another trap. You might unconsciously skip setups that would have lost or count setups that don't quite meet your criteria because they would have won. Stick to your written rules. If a setup doesn't meet every criterion, it doesn't count, regardless of the outcome.

Testing on too few trades is also problematic. Twenty trades is not enough to draw conclusions. Random chance can make any strategy look good or bad over 20 trades. Aim for at least 50, preferably 100 or more.

From Backtesting to Live Trading

A positive backtest is necessary but not sufficient. The next step is forward testing: applying your strategy in real time on a demo account or with very small position sizes. This bridges the gap between historical testing and live execution, revealing issues that backtesting can't capture, like slippage, emotions, and execution speed.

Forward test for at least 20 to 30 trades before committing real capital. If the forward test results roughly match your backtest results, you have confidence that the strategy's edge is real. If the forward test results are significantly worse, something is off, either the backtest was contaminated or the strategy relies on conditions that aren't present in the current market.

Track both your backtest and forward test results in TruthAlpha so you have a complete record of your strategy's evolution. When you eventually trade it live, you'll have a performance baseline to compare against. If live results deviate significantly from your backtested expectations, you'll know something has changed and can investigate. Start free and build that performance baseline from your first backtest.