Hi. I have an EA that closes all trades when in profit, and then restarts again. On restart...I need my EA to create a new OrderMagicNumber (on it's own) so the EA won't look at previous MagicNumber when deciding whether to close my orders.
This cycle must be continuous so if magicnumber is 1000, next will be 1001, then 1002, and so on.
I've tried adding a +1 like this: (OrderMagicNumber() == uniqueMagic +1) but that doesn't seem to work.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi. I have an EA that closes all trades when in profit, and then restarts again. On restart...I need my EA to create a new OrderMagicNumber (on it's own) so the EA won't look at previous MagicNumber when deciding whether to close my orders.
This cycle must be continuous so if magicnumber is 1000, next will be 1001, then 1002, and so on.
I've tried adding a +1 like this: (OrderMagicNumber() == uniqueMagic +1) but that doesn't seem to work.
Thank you in advance.
J