Building & Backtesting a Model
Building and backtesting an ICT model means writing every condition (bias, liquidity, shift, entry, stop, target, time window) precisely enough that anyone would mark the same trades, then replaying historical charts one bar at a time, logging every qualifying setup and measuring the results. The key output is expectancy: the average result per trade in R, the multiple of what you risk. Because ICT concepts have no published statistical proof, this process is how a trader finds out whether their version of the framework has an edge, how large it is, and how uncertain that estimate still is.

Results of a hypothetical sweep-and-shift model over 60 backtested trades: 24 winners averaging +2.4R, 36 losers at −1R each.
- Win rate = 24 ÷ 60 = 40%.
- Expectancy = 0.40 × 2.4 − 0.60 × 1 = 0.96 − 0.60 = +0.36R per trade.
- Profit factor = gross wins ÷ gross losses = (24 × 2.4) ÷ (36 × 1) = 57.6 ÷ 36 = 1.6.
- Breakeven win rate at 2.4R = 1 ÷ (1 + 2.4) ≈ 29.4%.
Looks good. Now the honest part:
- Uncertainty in the win rate. The standard error is √(0.4 × 0.6 ÷ 60) ≈ 0.063, so a rough 95% range is 27.6% to 52.4%. The low end is below the 29.4% breakeven.
- Uncertainty in expectancy. The standard deviation of these R outcomes is about 1.68, so the standard error of the mean is 1.68 ÷ √60 ≈ 0.217R. A rough 95% range is −0.07R to +0.79R. Zero is inside it.
- How many trades to exclude zero? If the mean and spread stayed the same, you would need about (1.96 × 1.68 ÷ 0.36)² ≈ 84 trades.
- 120 trades — First sample size here where the lower bound is above zero.
Assumes the same mean (+0.36R) and standard deviation (1.68R) at every sample size, using mean − 1.96 × SD ÷ √n. Hypothetical model, not real results.
Step 1: write the hypothesis
Start with one sentence: "In ES, between 9:30 and 11:00 a.m. New York, a sweep of the prior day's or overnight low followed by a 5-minute structure shift, entered at the FVG midpoint, reaches the overnight high more often than the stop below the sweep." One instrument, one window, one entry. Everything else waits.
Step 2: turn every word into a rule
The thresholds are examples; the principle is that no condition relies on judgement. If you keep a discretionary element, such as "clean" structure, write down what you mean and accept that results will be harder to reproduce.
Step 3: replay bar by bar
Use a replay mode that hides future bars. For each day in the test period, step forward one bar at a time, mark conditions as they occur, and log every setup that qualifies, including those that did not fill. Never skip a day because it "looked messy", and never look ahead to decide whether a setup counts. A backtest done by scrolling through finished charts will overstate results, sometimes dramatically.
Step 4: log the right fields
For each setup, record: date and time, instrument, window, liquidity type swept, entry variant, fill (yes or no), entry, stop, target, exit, result in R, maximum favourable and adverse excursion, and tags for optional confluences (SMT, OTE overlap, news day). These fields let you later ask which ingredient matters without re-running the test.
Step 5: measure
- Expectancy in R and profit factor.
- Win rate against the breakeven win rate for your average win size.
- Maximum drawdown in R and the longest losing streak.
- Results by window, liquidity type and entry variant.
- Fill rate, and the results of unfilled setups had they filled.
Step 6: expect losing streaks
With a 60% loss rate, long streaks are normal. Assuming independent trades, the probability of at least one run of six or more losses in 60 trades is about 70%; of eight or more, about 32%. If your plan cannot survive eight straight 1R losses psychologically and financially, reduce risk per trade before you start, not after the streak arrives.
Step 7: in-sample, out-of-sample, forward test
Design and tweak rules on one portion of the data (in-sample). Then run the frozen rules on a later, untouched portion (out-of-sample). If results collapse, the rules were fitted to noise. Only after the out-of-sample check, trade the model live at minimum size (a Micro contract, for example) for a defined number of trades, and compare live slippage, fill rate and expectancy with the backtest.
The advanced nuance: degrees of freedom
Every threshold you tune (fractal length, displacement multiple, gap size, window start, entry variant) is a degree of freedom. Try enough combinations and one will look excellent purely by chance. Keep the number of tuned parameters small, prefer round, sensible values over the single best-performing value, and judge a change by whether it improves results across neighbouring settings too. A model that only works at a 1.53× displacement and fails at 1.4× and 1.7× is fitted, not robust.
How professionals use the results
A professional treats a backtest as an estimate with error bars. They size so the realistic worst case (a long losing streak and a drawdown larger than the backtest showed) is survivable, they set a review point after a fixed number of live trades, and they write down in advance what result would make them stop trading the model. Your trading journal is the continuation of the backtest: the same fields, the same R measurement, a growing sample.
Common mistakes
- Backtesting on finished charts instead of bar-by-bar replay.
- Logging only filled or "valid-looking" trades.
- Judging an edge on a few dozen trades.
- Tuning until the curve looks perfect.
- Ignoring costs: commissions, slippage on stops, and partial fills.
- Skipping the out-of-sample check because the in-sample result was exciting.
1. Win rate 40%, average win 2.4R, losses −1R. What is the expectancy?
2. What is the breakeven win rate for an average win of 2.4R and average loss of 1R?
3. Why can 60 trades at +0.36R still fail to show an edge?
4. What is the purpose of the out-of-sample period?