Template with eight indicators, all of them looking fine on the chart. Then the screen stutters when a busy minute arrives and entries come late. Each indicator runs its calculation on every incoming tick, and in the classic platforms the indicators attached to charts of the same symbol often share limited threads, so one lazy piece of code delays the rest.
The usual culprits are not exotic. An OnCalculate that loops over the full history on every tick instead of using prev_calculated. Multi-timeframe calls that rebuild another timeframe each time. Dozens of objects drawn and redrawn. Repainting logic that scans back 500 bars to adjust values. Multiply a 2,000-bar loop by six indicators and by ten ticks a second, and the arithmetic gets uncomfortable.
Measuring is easier than it sounds. Remove indicators one at a time and watch how responsive the chart feels during a fast market, or wrap the calculation in a millisecond timer and print the result to the log. Anything that needs only closed-bar values should run on new bars only.
Cutting the bars loaded on the chart also reduces the work. For a scalping chart, a few thousand bars is typically plenty.
Which indicator turned out to be the slowest one in a template once it was actually timed?
The indicator stack that costs 200 ms per tick
-
Amanhasnoname
- Posts: 1506
- Joined: Fri Oct 30, 2026 9:45 am