Just by looking at your code:
you can open several orders, so you could store their individual ticket numbers in an array in a global variable.
As you defined them local they get lost after the next ea call (so the next tick)
Regards
Uwe
Sorry, I can understand condition if see cross, vs. condition for Buy above - simple M1 is over M2 ?! Where is condition for Sell??
You must be brave
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
Hello,
I have only been learning to code with MQL4 for a couple of months and I am looking to write an EA which opens a trade when MA cross and closes the trade when they cross again. I need a helping hand as the EA won't seem to close the trade. Thank you.
Here is my code: