I want my EA to only enter on the first signal, e.g. when the 3 MA crosses the 8 MA when both are above the 200 MA. At the moment the EA will do this on every cross above the 200 MA, but I would like to set it to ONLY enter on the first 3/8 cross above/below the 200MA. If I can find out how to do this it would be great as I could then apply it to other indicators, to only take the trade on the frist instance of a technical analysis.
- Indicators with alerts/signal
- Strategy testing works on one platform but not the other
- MA Crossover EA
gangsta1: I want my EA to ...
gangsta1:
I want my EA to only enter on the first signal, e.g. when the 3 MA crosses the 8 MA when both are above the 200 MA. At the moment the EA will do this on every cross above the 200 MA, but I would like to set it to ONLY enter on the first 3/8 cross above/below the 200MA. If I can find out how to do this it would be great as I could then apply it to other indicators, to only take the trade on the frist instance of a technical analysis.
I want my EA to only enter on the first signal, e.g. when the 3 MA crosses the 8 MA when both are above the 200 MA. At the moment the EA will do this on every cross above the 200 MA, but I would like to set it to ONLY enter on the first 3/8 cross above/below the 200MA. If I can find out how to do this it would be great as I could then apply it to other indicators, to only take the trade on the frist instance of a technical analysis.
In beginning of EA, define a static bool variable and set it to false. Now along with the cross condition, check if variable is false. set that variable to true when cross happens.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register