Passing value to EA from custom indicator

 
I want to pass the value a variable from a custom indicator to an EA. Since the EA doesn't use the external buffer I think I an use it to get the data. Is this right? it's going to be a simlpe int value of 1 or 0. Or are these only used to paint item on the chart. If this is not possible can I have EA search the chart for a wingding to see if it's there or not? If so, would I have to know Exactly where to find it ?

I know you can put the indicator code inside the each, but the custom indicator calls another custom indicator, too much for my little brain...Is there another way to do this?

Can this be done?

thanks in advance...

d
 

To pass numerical values between indicator and EA you can use GlobalVariables

https://docs.mql4.com/globals

Indicator would use GlobalVariableSet(), and EA would use GlobalVariableGet().

You can find Objects on a chart by name or by a property of the object.

for(i = ObjectsTotal()-1; i >= 0; i--){

string name = ObjectName(i);

... here are more decisions, depending on what you are trying to find...

... like if(ObjectType(name) == ... )

if(ObjectGet(name, OBJPROP_COLOR) == ... )

... and so on until you find or don't find what you are looking for

 
phy:

To pass numerical values between indicator and EA you can use GlobalVariables

https://docs.mql4.com/globals

Indicator would use GlobalVariableSet(), and EA would use GlobalVariableGet().

You can find Objects on a chart by name or by a property of the object.

for(i = ObjectsTotal()-1; i >= 0; i--){

string name = ObjectName(i);

... here are more decisions, depending on what you are trying to find...

... like if(ObjectType(name) == ... )

if(ObjectGet(name, OBJPROP_COLOR) == ... )

... and so on until you find or don't find what you are looking for

Phy

thanks so much.... I have never used GlobalVariables and FORGOT THEY EXIST. . I amaze myself sometimes with my stupidity..LOL

thanks again

David
 
phy:

To pass numerical values between indicator and EA you can use GlobalVariables

https://docs.mql4.com/globals

Indicator would use GlobalVariableSet(), and EA would use GlobalVariableGet().

You can find Objects on a chart by name or by a property of the object.

for(i = ObjectsTotal()-1; i >= 0; i--){

string name = ObjectName(i);

... here are more decisions, depending on what you are trying to find...

... like if(ObjectType(name) == ... )

if(ObjectGet(name, OBJPROP_COLOR) == ... )

... and so on until you find or don't find what you are looking for

Is it better to pass GlobalVariables from an Indicator to an EA or should the EA include the Indicator - calling the Indicator via iCustom() requires different parameters to be passed if the Indicator output consists of more than one value. Is that right?

Reason: