if(ticket1<=0 && ticket2<=0)
Hi,
I'm new to MQL4 and am trying to learn. I need help trying to setup a basic EA. Keep in mind I am doing this one so I can learn how and not necessarily because it will be profitable. I want to set up an EA that opens two trades simultaneously, one buy and one sell and as soon as both trades close I want it to immediately execute another buy and another sell. This is the code that I have so far:
When I do this it will open the trade in the first if statement. Those two trades will then close out but I cannot get it to enter into trades afterwords. After the trades close the ticket1 and ticket2 are set back to -1, I verified this with an Alert command. What do I do so this will work?
Show the code that resets the values.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm new to MQL4 and am trying to learn. I need help trying to setup a basic EA. Keep in mind I am doing this one so I can learn how and not necessarily because it will be profitable. I want to set up an EA that opens two trades simultaneously, one buy and one sell and as soon as both trades close I want it to immediately execute another buy and another sell. This is the code that I have so far:
When I do this it will open the trade in the first if statement. Those two trades will then close out but I cannot get it to enter into trades afterwords. After the trades close the ticket1 and ticket2 are set back to -1, I verified this with an Alert command. What do I do so this will work?
Thanks in advance