Reading Indicator Buffers in a Replay Trading System
Summary
This article explains how an Expert Advisor can read meaningful output from a custom indicator as part of a MetaTrader replay and simulation system. It builds on earlier work sending data from the EA to the indicator, then describes the reverse direction: sharing a short name, configuring the indicator, and retrieving its buffer values for use by the EA.
The examples also cover packaging the indicator inside the EA as a resource, using the resource-specific loading syntax, and removing an existing chart instance before reloading so updated settings take effect. The EA checks that the expected amount of data was copied and converts the returned numeric value for display. These steps establish communication between the EA and indicator and prepare the system for a chart trader.
The article is an introductory programming walkthrough, not a trading strategy or performance study. Its discussion is limited to the basic transfer setup; it notes that later work will address hiding the indicator and other more complex configurations.
Key ideas
- An EA can retrieve indicator output by reading the indicator's data buffer.
- A shared short name helps the EA and indicator refer to the same chart indicator.
- Removing an existing indicator before reloading helps synchronize its settings with the EA.
- Embedding the compiled indicator as an EA resource can make the EA independent of a separate indicator file.
- The example checks the amount of copied data before using the returned value.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.