Why are liquidity sweeps hard to backtest?
Liquidity sweeps are hard to backtest because the pattern's usual definition includes its own outcome. A sweep is a poke that reversed — so a tester that identifies sweeps and then measures whether they reversed is measuring a tautology, and will report something close to a perfect record.
The fix is to separate the trigger from the grade. The trigger has to be something observable at a single moment: price traded beyond this level by at least this much. The grade is what happened over a fixed window afterwards. Once those are separate, the test can report how often the trigger was followed by a reversal, which is the number you actually wanted.
The second difficulty is that a sweep entry sits close to its invalidation by construction. You enter on the return through the level and your stop goes beyond the extreme of the poke, which is often only a handful of pips away. Tight stops make every execution assumption load-bearing: spread, slippage, and the order in which prices were reached inside the entry bar all move the result more than they would for a wider setup.
How do you define a sweep mechanically?
Define it as four separate decisions, each written down before you run anything: which levels qualify, how far beyond counts as a poke, what counts as returning, and how long the return has to happen in.
Which levels qualify. Swing highs and lows found by a fixed rule, session extremes, prior-day extremes, or a combination. The rule has to be computable from data available at that moment — a swing high confirmed by later bars is not available when the earlier bars are being tested, and using it is look-ahead.
How far beyond counts. A poke of one pip is noise on most instruments. Expressing the threshold in ATR rather than pips makes the rule portable across instruments and volatility regimes, which also stops you from accidentally tuning a separate threshold per pair and calling it research.
What counts as returning. A wick back inside is a much weaker condition than a close back inside, and the two produce meaningfully different trade sets. Pick one and hold it.
How long it has. Without a deadline, every poke eventually reverses given enough time, and the test degenerates. A fixed horizon — after which the occurrence is graded as expired rather than quietly ignored — is what stops the sample from silently excluding its failures.
What does sub-bar resolution change?
Sub-bar resolution decides which of your stop and target was reached first when both sit inside the same bar, and for sweep setups that situation is common rather than rare.
Consider the shape of the trade. Entry on the return through the level, stop just beyond the extreme of the poke, target somewhere back inside the range. On a fifteen-minute chart, a volatile bar can easily contain the entry, the stop and a good part of the target. The bar's open, high, low and close cannot tell you the order in which those prices were visited.
Testers resolve this in different ways, and the difference is not small. Assuming the target came first makes a sweep strategy look excellent. Assuming the stop came first makes it look poor. The honest resolution is to descend to finer data — minute bars inside the fifteen-minute bar, or tick data inside the minute — and where no finer data exists, to book the loss and say so.
This is worth checking in whatever tool you use, because most do not advertise their choice. If you cannot find the answer in the documentation, run a deliberately ambiguous test: build a setup where the stop and target are both certain to fall inside one bar, and see which one the tester reports.
How many trades do you need before the result means anything?
You need enough occurrences that the result would survive a bad run, which for setups with roughly balanced win rates means hundreds rather than dozens — and sweep strategies often produce far fewer occurrences than people expect.
The arithmetic is unforgiving. Tighten the definition — only fresh levels, only London session, only pokes greater than one ATR, only closes back inside within two hours — and each restriction cuts the sample. Four sensible restrictions can take a thousand occurrences down to forty, and forty tells you almost nothing while looking exactly as convincing on a chart.
This is the tension at the centre of sweep research. The strictest definitions produce the prettiest examples and the smallest samples. The loosest definitions produce enough data to say something and include occurrences you would never have traded. Neither extreme is right, and the only way through is to state the definition, report the count, and let the count discipline the confidence.
How do you avoid fitting the sweep definition to the data?
Avoid fitting by treating every definitional choice as a trial and counting them, because the four decisions above have dozens of plausible settings between them and the best combination will always look like a discovery.
Split the history before you start. Fix the definition on the earlier portion, then grade it once on the later portion you have not looked at. If the out-of-sample result collapses, that is the answer, and it is a far more valuable answer than a tuned in-sample curve.
Then be honest about how many combinations produced the number you are looking at. Thirty variants of a definition applied to the same history will produce a best variant regardless of whether any edge exists, and the winner's apparent quality tells you nothing about which case you are in. Recording the count of attempts is what makes the difference visible — and it is the single easiest discipline to skip, because nobody else can see whether you did it.
Finally, sanity-check against a null. Take the same trigger and apply it to randomly chosen levels rather than structural ones. If random levels produce a similar result, the structure was not doing the work.