Try without this: OrderSelect(i, SELECT_BY_POS);
The first one is all you should need. try with that commented out.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
}
could someone please help me here!? the above code works well but essentially it closes ALL buy or sell orders. I want it to close only the order corresponding to magicnumber 21 and then one other one order with a different magicnumber....how can i accomplish this? i am running multiple ea's and don't want this piece of code closing any other system generated trades. any help would be greatly apprreciated! Thankyou all. daniel