Reducing Memory Use in Multi-Timeframe Composite Indicators
Summary
This implementation article examines memory use in composite MetaTrader indicators that call auxiliary indicators across several timeframes or instruments. Its example combines Ichimoku and price-channel signals across five timeframes. Since each auxiliary indicator allocates buffers, the combined setup can use substantially more memory than its displayed output suggests; the article estimates buffer storage from the number of buffers and history values.
It presents two broad ways to reduce use: limit chart history through the terminal’s maximum-bars setting, or reduce the buffers needed by auxiliary indicators. The latter can involve modifying an indicator to retain only required outputs or restructuring how its calculations are incorporated into the composite indicator. The article reports that such approaches can have differing memory effects and that moving code into the main indicator is not always efficient, partly because of price-series caching. The savings depend on the indicators and setup, and the proposed changes require programming access to their source.
Key ideas
- Composite indicators multiply memory use through the buffers allocated by each auxiliary indicator and timeframe.
- Reducing the terminal’s maximum chart history decreases the number of values held in indicator buffers.
- A programmer can remove auxiliary outputs that the composite indicator does not use, if the source code is available.
- Alternative code structures have different memory effects, and incorporating calculations into the main indicator may increase cached price-series use.
- The practical savings depend on the indicators, timeframes, chart history, and number of instruments in use.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.