Sharing Indicator Buffers Between MQL Programs Through DLL Pointers
Summary
The article presents a way for MQL4 and MQL5 indicators to read one another’s data buffers without repeatedly calling the standard custom-indicator access functions. Its approach passes a dynamic array’s memory address to a small C++ DLL, then uses that address to read buffer values. MQL terminal global variables hold descriptors that identify the buffer, including its indicator label, symbol, timeframe, size, indexing direction, and a distinguishing value for multiple instances.
The article explains its assumptions about array layout and pointer representation, then describes registering and removing descriptors as buffers change. It also discusses adapting the approach across MQL versions and suggests uses such as chained indicators and Expert Advisors. Its support is mainly a technical argument and reported operation of the author’s library, not a controlled performance comparison. The method relies on undocumented memory behavior, low-level pointer conversion, and a DLL; incorrect addresses or bounds can destabilize the terminal. Readers should therefore treat it as a fragile implementation technique rather than a general indicator-design recommendation.
Key ideas
- The proposed method exposes an indicator buffer’s memory address through a C++ DLL.
- Terminal global variables act as a descriptor table for finding buffers and their metadata.
- Buffer length and indexing direction are tracked to interpret values and limit invalid access.
- The method is intended to avoid repeated indicator calculation or data copying between MQL programs.
- Its reliance on assumptions about memory layout and pointer handling creates substantial stability risks.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.