๐ŸŽ“Iris Courses
โ† Advanced Technical Analysis
Day 11 of 14

Backtesting Your Strategy

Why and How to Backtest Properly

Backtesting is the process of applying your trading rules to historical data to measure how the strategy would have performed. Done rigorously, it's the closest thing to a controlled experiment in trading. Done sloppily, it produces misleading results that give false confidence. The goal of backtesting: to determine whether your strategy has a genuine statistical edge across a meaningful sample size (100+ trades minimum, ideally 500+) and across different market regimes (uptrending, downtrending, ranging, high volatility, low volatility). Manual backtesting: scroll the chart to the left (into historical data), hide the right side, and work through the chart bar by bar making trading decisions according to your rules, without looking ahead. Record every trade. This is the most thorough method โ€” you develop pattern recognition and an intuitive feel for your strategy. It's also time-consuming: 100 trades typically takes 3-5 hours. Automated backtesting: write code (Python with backtrader/vectorbt, or use TradingView's Pine Script) that applies your rules mechanically to historical data. This is faster and eliminates hindsight bias in signal identification, but requires precise rule definition โ€” which is actually valuable, because it forces you to be explicit about exactly what triggers a trade. The most common backtesting errors: look-ahead bias (using information in your rule that wouldn't have been available at the signal time), curve fitting (optimizing parameters to fit historical data so precisely that the edge disappears on new data), survivorship bias (testing on a list of current stocks, which excludes the stocks that went bankrupt or delisted), and insufficient sample size (drawing conclusions from 20 trades).

Interpreting Backtest Results

Raw backtest results include many metrics. Here are the ones that actually matter and how to interpret them. Win rate alone is meaningless. A 70% win rate with a 0.5:1 reward-to-risk is worse than a 40% win rate with 3:1 R:R. Always look at win rate AND reward-to-risk together to calculate expected value: EV = (Win Rate ร— Avg Win) - (Loss Rate ร— Avg Loss). Positive EV is the requirement for a viable strategy. Profit Factor = Gross Profits / Gross Losses. A profit factor above 1.0 means the strategy is profitable. Typical good strategies have profit factors of 1.3-2.0. Above 3.0 is suspicious (often indicates curve fitting). Below 1.2 is marginal. Maximum Drawdown is the peak-to-trough loss during the backtest period. A strategy with 200% total return but a 70% max drawdown is untradeable for most people โ€” they'd quit during the drawdown. Your strategy's max drawdown should be survivable both financially and psychologically. Consistency: divide your backtest period into 3-4 sub-periods and check performance in each. If a strategy made all its profit in one sub-period and barely broke even in the others, it's not robust. You want reasonably consistent performance across different market periods. Walk-forward testing: split your data into in-sample (for optimization) and out-of-sample (for testing). Optimize on the in-sample data, then test on the out-of-sample data without any optimization. If performance collapses on the out-of-sample period, you've curve-fit. This is the gold standard validation test.

โšก Today's Action

Define one specific strategy (e.g., 'Buy when daily RSI shows bullish divergence AND price is at a Fibonacci 61.8% retracement, stop below the prior swing low, target at the prior swing high'). Manually backtest it on 2 years of one asset's daily data. Record at least 50 trades.

๐Ÿ’ก Pro Tip

Before backtesting, write your rules in plain English so precisely that someone with no trading knowledge could mechanically follow them. If your rules require judgment ('enter when the pattern looks clean'), they're not testable. Precise rules produce testable, trustworthy backtests.