Multiple orders

 
Does anybody know the code needed to open and close multiple orders on the same chart. I think it has something to do with magic numbers?
 
stedyer:
Does anybody know the code needed to open and close multiple orders on the same chart. I think it has something to do with magic numbers?


stedyer:

I think what you want is to use OrderSend(..), read this:

https://docs.mql4.com/trading/OrderSend

This will open any order you want and with any currency pair. I am not sure what you want to be done exactly but to close orders this is what you use:

https://docs.mql4.com/trading/OrderSelect

Followed by:

https://docs.mql4.com/trading/OrderClose

You can use the lucky numbers to check if the order you are closing is the one you want. I recommend reading this tutorial:

'Expert Advisor Sample'

It’s an excellent example of a simple EA.

Hope this helps.

Hazem

Reason: