How to Backtest Candlestick Patterns Without Fooling Yourself

10 min readQuantParadox research

Candlestick statistics circulate endlessly and almost never carry the one number that would make them meaningful: what the same measurement gives for an ordinary bar.

The short answer

Backtesting a candlestick pattern requires computing the same forward outcome for every bar in the history and comparing the pattern subset against that base rate, because a pattern's hit rate quoted alone tells you nothing about whether it selected anything.

Why is a pattern's hit rate meaningless on its own?

A hit rate is meaningless alone because it has no reference point, and the reference point — what happens after an average bar — is usually far closer to the pattern's number than anyone expects.

Suppose a source reports that a bullish engulfing bar is followed by a higher close 56% of the time. That sounds like an edge until you compute the same statistic across all bars in the same period and find it is 55%. The pattern contributed one percentage point, which will not survive the spread.

The reason base rates are rarely quoted is that computing them requires the full dataset rather than the pattern instances, and most informal analysis starts by filtering to the pattern. Once you have filtered, the comparison is no longer available.

So the very first step in any candle study is to compute the outcome for every bar. Everything after that is a comparison, and comparisons are what carry information.

How do you define the outcome you are measuring?

Define the outcome as a symmetric, cost-aware question with a fixed horizon: did price travel X in your favour before travelling X against, within N bars?

That framing is better than 'was the next close higher' for two reasons. It reflects how a trade actually resolves — stops and targets, not closing prices — and it is symmetric, so it cannot be gamed by a horizon that happens to sit in a drifting market.

Express X in ATR rather than pips so the measurement is comparable across instruments and volatility regimes. A twenty-pip target means something different on every pair, and pooling unnormalised results across pairs produces a number that describes the pair mix.

Then include costs in the outcome. Subtract a realistic spread from the favourable threshold and add it to the adverse one. Many candle effects that look real gross of costs disappear entirely net of them, and finding that out is the point of the exercise rather than a disappointment.

How many variants should you count?

Count every definitional choice and every threshold as a separate trial, because candle research typically involves far more of them than the write-up admits.

A modest study of one pattern might involve three body tolerances, two prior-trend requirements, three horizons and two target sizes. That is thirty-six combinations, and the best of thirty-six will look impressive even if the pattern carries no information at all. Reporting only the best combination is the most common way candle statistics become misleading.

The straightforward defence is to record the count and let it set the bar. A result that would be interesting as a first attempt needs to be considerably stronger to be interesting as the best of thirty-six, and there are standard ways to adjust for that once you know the number.

The harder defence is holding a slice of the history back and grading the chosen combination there exactly once. It costs data and it is the only check that cannot be argued with.

What context splits are worth making?

Split by whether the pattern occurred at a structural level, by the prevailing higher-timeframe direction, and by session — because pooling contexts averages an effect that may exist in one with its absence in the others.

Level context tends to matter most in practice. A candle pattern in the middle of a range and the same pattern at a swing high are different events, and the level supplies the selectivity that the candle shape lacks. If you only run one split, run this one.

Direction context matters because reversal patterns and continuation patterns are claims about direction. A bullish engulfing bar in a downtrend and one in an uptrend are testing different propositions, and pooling them tests neither.

Session context matters on instruments with strong intraday liquidity cycles. A pattern forming in a thin session may reflect little participation, and thin-session bars often behave differently for reasons that have nothing to do with the pattern.

Every split costs sample size, which is why they should be chosen deliberately and in advance rather than explored until something interesting appears. Exploring splits is a search over contexts, and the best of ten contexts needs the same scepticism as the best of ten parameters.

Questions people actually ask

Do candlestick patterns work at all?

Standalone candle patterns generally show small differences from the base rate — often small enough that spread and slippage consume them. That is not the same as saying they are useless: as timing triggers inside a setup that already has a structural reason, they earn their place. The distinction between a signal and a trigger is the useful one.

How many occurrences do I need for a candle pattern test?

For effects this small, hundreds of occurrences rather than dozens, and ideally enough that you can hold a portion back for out-of-sample validation and still have a usable sample on each side. Because candle effects tend to be marginal, the sample sizes required to distinguish them from noise are larger than for a strategy with a bigger per-trade edge.

Should I test candlestick patterns on multiple instruments?

Yes, and consistency across instruments is one of the strongest available signs that an effect is real rather than fitted. A pattern that works on one pair and reverses on three is what splitting on an uninformative variable looks like. A pattern that points the same way on most liquid instruments, even with varying magnitude, is much harder to explain as chance.

The only backtest that settles it is yours.

Build a strategy from a sentence, paste your own Python, or import your live trade history and have it graded. Five full backtests free, no card, and we'll tell you plainly when the result is indistinguishable from luck.

We publish research and tooling, not trading advice, and we make no claim about future returns. Everything above describes how to test an idea — not a reason to trade one.