- "MT5 OrderSelect() doesn't work." Do you really believe that no one in 10+ years has ever realized this? Or is it more likely that it is you that doesn't understand?Do not confuse current pending orders with positions
Trade Functions / OrderSelect - Reference on algorithmic/automated trading language for MetaTrader 5 - The order has opened. It doesn't exist. Select the position.
- "MT5 OrderSelect() doesn't work." Do you really believe that no one in 10+ years has ever realized this? Or is it more likely that it is you that doesn't understand?
- The order has opened. It doesn't exist. Select the position.
I still do not understand. But thank you for you answer.
I think, I opened a simple Buy market order (not pending order). It was a deal. Really,, I still don't know exactly what 'deal' means. I'll be back on Monday, and test it again...
I think, I opened a simple Buy market order (not pending order). It was a deal. Really,, I still don't know exactly what 'deal' means. I'll be back on Monday, and test it again...
You must understand all the concepts and inner workings of an EA, otherwise you will get screwed with unwanted behavior in the future...
https://www.mql5.com/en/articles/211

- www.mql5.com
Dear Coders,
I'm working on an MT5 Expert Advisor. I would like to use the OrderSelect() function, but it doesn't work for me. Every time I get "Order not fouund" error message.
Here is my code:
Toolbox\Experts output:
"OrderSelect Error on Ticket #280472054. Order not found. EC: 4754"
The position (Ticket #280472054) existed. It was open. But the EA couldn't select it. What can be the problem? What can I try to do?
Thank you in advance.
Relative
- "MT5 OrderSelect() doesn't work." Do you really believe that no one in 10+ years has ever realized this? Or is it more likely that it is you that doesn't understand?
- The order has opened. It doesn't exist. Select the position.
Me too have issue...
I'd like to select an order (not position or deal) into history using COrder class but I don't understand why this code doesn't work :-(
if(HistorySelect(0, TimeCurrent())) for(int i = HistoryOrdersTotal() - 1; i >= 0; i--) if(order.SelectByIndex(i)) Comment(order.Ticket(),"\n",order.PriceOpen());

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Coders,
I'm working on an MT5 Expert Advisor. I would like to use the OrderSelect() function, but it doesn't work for me. Every time I get "Order not fouund" error message.
Here is my code:
Toolbox\Experts output:
The position (Ticket #280472054) existed. It was open. But the EA couldn't select it. What can be the problem? What can I try to do?
Thank you in advance.
Relative