Advertisement IC Markets

Acting on bar close versus mid-bar

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Amanhasnoname
Posts: 1506
Joined: Fri Oct 30, 2026 9:45 am

Acting on bar close versus mid-bar

Post by Amanhasnoname »

Many strategies trigger when a bar closes beyond a level. Others trigger the instant price crosses it. The two behave very differently, and mixing them up in backtests creates false results.

Waiting for the close removes noise and avoids fake breakouts, but the entry is delayed, sometimes by most of the move. Acting mid-bar gets in earlier but suffers from false triggers when price pokes through and returns.

In a backtest built on candles, acting on close is clean, since the data is final. Acting mid-bar needs tick data, or assumptions about when the level was crossed.

A common error is writing the rule as close-based in the test and trading it mid-bar live, or the other way around. The live results then differ for reasons that are hard to find.

Be explicit. Write down exactly when the signal is evaluated, and make sure the live implementation matches.

Which approach does your strategy use, and was it compared against the alternative?
Recommended broker for automated trading & scalping IC Markets
Post Reply