-
uint total = OrdersTotal(); for(uint i=0 ; i < total ; i++){ if((ticket=OrderGetTicket(i))>0) { symbol = OrderGetString(ORDER_SYMBOL); order_magic = OrderGetInteger(ORDER_MAGIC);
There are no such functions in MT4.
Why did you post your MT5 question in the MQL4 section, (bottom of the Root page) instead of the MT5 General section?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon. - Once a pending order opens, it is not an order, it is a position.
MT5: first select a position via CPositionInfo, directly, or by 'MT4Orders' library (2016)
![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
Hey all,
I have written the following code to check if there is an open order with a matching symbol and magic number within my multi-symbol EA, but it does not prevent multiple orders from opening.
The OpenTradeOrderTicket is a global array that is meant to store a 1 or 0 depending on whether there is an open order on the current symbol in the loop but doesn't.
I tried to debug with the Print's that you can see but they do not print anything which leads me to believe the loop is not even running for some reason.
Any advice is greatly appreciated.