Advertisement IC Markets

A custom indicator can be the slowest part of the whole chain

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

A custom indicator can be the slowest part of the whole chain

Post by Fairman »

A custom indicator can be the slowest part of the whole chain

A fancy indicator recalculates over thousands of bars on every tick. On a quiet pair it hardly matters. In a fast market, it can add hundreds of milliseconds of delay.

The cost shows up as a lag between price changes and the platform's response. Signals arrive late. Orders go out later still.

Poorly written indicators are a known culprit. Loops that run over the entire history each time, repeated calls to heavy functions, and drawing lots of objects on the chart all take their toll.

A quick check is to remove the indicator and see if the platform becomes more responsive. Another is to look at the CPU usage of the terminal while the market is moving.

Well-written indicators calculate only the newest bar. Lightweight alternatives often give the same information.

Profiling is simpler than it sounds. Log the time at the start and end of the indicator's calculation for a few thousand ticks and look at the maximum, not the average. A routine that usually takes two milliseconds but occasionally takes 300 is the one causing missed entries, and the average will never show it.

Which indicators are running during live trading, and has anyone checked their effect on speed?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Post Reply