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?
- Closing Multiple Orders
- MQL4 Learning
- EA which closes all orders accross multiple currency pairs with same magic number.
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?
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:
It’s an excellent example of a simple EA.
Hope this helps.
Hazem

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