A custom indicator can be the slowest part of the whole chain
Posted: Fri Oct 30, 2026 10:16 am
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?
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?