| / | Forum |
|
dwt1020
2008.01.05 01:31
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 |
|
Testing Features and Limits in MetaTrader 4 This article allows to find out more about features and limits of Strategy Tester in MetaTrader 4. |
|
phy
2008.01.05 04:28
To pass numerical values between indicator and EA you can use GlobalVariables 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 |
|
dwt1020
2008.01.05 04:39
phy wrote: Phy To pass numerical values between indicator and EA you can use GlobalVariables 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 thanks so much.... I have never used GlobalVariables and FORGOT THEY EXIST. . I amaze myself sometimes with my stupidity..LOL thanks again David |
|
opti
2008.08.11 21:51
phy wrote >>
To pass numerical values between indicator and EA you can use GlobalVariables 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? |