Quote:
|
Originally Posted by Toddr
I have gone down to 2 moving averages, but it puts me in the wrong way or not at all. (attached)
Buy logics:
MA (1) Previous < MA (2) Previous
AND MA (1) Current > MA (2) Current
Sell logics:
MA (1) Previous > MA (2) Previous
AND MA (1) Current < MA (2) Current
|
The logics are ok. It should be working now. The mql you attached was not generated from above logics. The logics in the attached mql are opposite what you write here, so put above logics again, compile it to mql file, and overwrite the old expert file (or delete the old one first before copy the newly compiled mql).
Quote:
|
Originally Posted by Toddr
Also I want it to exit the trade when the moving averages cross in the opposite direction. or when the take profit or trailing stop is hit, whichever comes first.
Thanks
|
No need to do anything. Opposite trade is automatically closed before entering a new trade. If SL/TP is hit then the broker will close the trade for you automatically too.