Advertisement IC Markets

Which came first, the stop or the target?

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Which came first, the stop or the target?

Post by Fairman »

Which came first, the stop or the target?

A bar with a high above the target and a low below the stop leaves a question: which was hit first? On bar data, nobody knows.

Backtesters answer in different ways. Some assume the stop was hit first, which is conservative. Some assume the target, which is generous. Some use an arbitrary rule based on how the bar closed. Each choice changes the results, sometimes dramatically.

For scalpers with tight stops and targets, a large share of bars can contain both. The assumption then drives the whole outcome.

Tick data resolves it by showing the real order. A test on ticks might reveal that half the trades the bar test counted as wins were actually losses, because the stop came first.

If tick data is unavailable, the conservative rule is the safest default. A strategy that still works when every ambiguous bar is treated as a loss has a real edge.

Some traders also run both assumptions, stop first and target first, and check the gap between the two results. A narrow gap means the strategy is not sensitive to the ambiguity. A wide gap means the result depends on a guess, and should not be trusted.

How does the backtest handle bars that touch both the stop and the target?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Amanhasnoname
Posts: 2060
Joined: Fri Oct 30, 2026 9:45 am

Re: Which came first, the stop or the target?

Post by Amanhasnoname »

I used to let the backtester mark a win if the target was touched anywhere in the bar, which is the generous answer. I later rebuilt the same EURUSD one-minute rules on tick data. Over four months that was nine hundred and sixty trades. About sixteen percent of them, one hundred and fifty-four bars, touched both the stop and the target. Under the old target-first rule expectancy was plus twenty-eight hundredths of R. Treating every ambiguous bar as a stop cut it to plus seven hundredths.

The tick replay came in at plus ten hundredths, close to the conservative figure. Of those one hundred and fifty-four mixed bars, seventy-one hit the stop first and had been counted as winners in the generous model. That single assumption had been carrying a large part of what I thought was the edge.

I now run both versions side by side. If the gap between stop-first and target-first is wide, I distrust the test and I will not fund it. A method that still holds up when every unclear bar is treated as a loss is the only one I will trade with a tight stop and target.
Post Reply