Simple moving average cross EA PLEASE HELP ME
-
@fxdreema Hello!! I am having so much trouble with making my EA I am doing a very simple moving average cross EA for mt4, I want to buy when it crosses over and close sell positions then sell when it crosses again and close buy positions ect, when I run this I get a critical error zero divide, please please please help me find a way to get this working I have been trying to code this in mql4 from scratch then gave up and found fxdreema and I love this idea but similar problems, I would be so thankful if you could help me thank you so much!!!!!
Brian
-
Put "once per bar" on top of your project, and also use candle ID 1 in the block settings. These are the basic tricks for every problem lol
-

-

-

-
I changed the candle to 1 in the condition and it got further, because before i made that change it crashed directly after the sell order was placed, but I am still having the same problem but I cant figure out specifically what to change to get this working properly, I appreciate the help!!! any ideas?? THANK YOU SO MUCH!!
Brian
-
Disconnect those 'Close trade' blocks. You need to create a new tree specifically dedicated to closing trades headed by a 'For each trade' block.
-
@l-andorrà thank you!!
-
You're welcome.