Only enter on first signal
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
- Alert Signal
- Strategy testing works on one platform but not the other
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.