I'd like to write an EA that tracks an indicators values over all timeframes but I need to get the current values that are set on this indicator.
For instance: double l_icustom_84 = iCustom(NULL, TIMEFRAME, "SMAAngle", SMAMODE, ANGLET, PREVSHIFT, 0, 0, 0). I need to get the values on SMAMODE, ANGLET and PREVSHIFT. These values are customizable in the indicator.
How can this be done?
1. The parameters must be type extern in the indicator
2. They must be cast as the same type in both the indicator and the EA
3. The parameters must be listed in the same order as they are declared in the indicator
From the docs: "The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator."
The obvious way is to duplicate the indicator properties in the EA and run the EA with the same values as the indicator.
Alternatively you can modify the indicator source code to export indicator setup values to Global Variables and read the actual setup parameters from GV before iCustom call.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'd like to write an EA that tracks an indicators values over all timeframes but I need to get the current values that are set on this indicator.
For instance: double l_icustom_84 = iCustom(NULL, TIMEFRAME, "SMAAngle", SMAMODE, ANGLET, PREVSHIFT, 0, 0, 0). I need to get the values on SMAMODE, ANGLET and PREVSHIFT. These values are customizable in the indicator.
How can this be done?