Read Current Values for Indicator

 

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?

 
mixtermind wrote >>

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.

Reason: