if (order_type == 1||0)
false = 0, true = nonzero, therefor you have
if (order_type == 1||false)
which means it only executes on order type 1. Use:if (order_type == OP_SELL || order_type == OP_BUY)
- order_type is 1 or 0 if one of the two orders was triggered, but the OrderDelete doesn't work.You can't delete open orders only pending orders.
- What are Function return values ? How do I use them ? - MQL4 forum
Hi WHRoeder,
thank you very much for your fast and detailed answer!
I will give it a try now, but I am sure that it will work as you mentioned it above.
Edit: Works, thx again!
Kind regards,
John
![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
Hi,
I have an EA for each Pair that i trade - all of these EA's contain this code:
The order_type is 1 or 0 if one of the two orders was triggered, but the OrderDelete doesn't work.
Does anybody know what the problem is?
Thank you all in advance!
Kind regards,
John