How to code and EA that is triggered by two indicators that doesn't give signals on the same bar ?!

 

I wonder how to make an EA that is triggered by two indicators ( leading / lagging ) .. I mean that their signals does not appear on the same bar ?! For Example : if I am using a stochastic cross as a primary signal and I want the EA not to start the buy or sell order till it gets a confirmation from MA cross ?!! I appreciate your help in this code Regards,

Hossam Habib

 
enghoss77:

I wonder how to make an EA that is triggered by two indicators ( leading / lagging ) .. I mean that their signals does not appear on the same bar ?! For Example : if I am using a stochastic cross as a primary signal and I want the EA not to start the buy or sell order till it gets a confirmation from MA cross ?!! I appreciate your help in this code Regards,

Hossam Habib

its very simple, you first give the condition for the MA then add "&&" Stchastic condition.


Note: there is a difference between MA crosses above/below and MA is above/below you need to specify which while coding