PositionsTotal() returns 0 while an pending stop order is placed...

 

Dear Forum,


Im traying to handle my placed orders, as I found in many threads usually it is handled by the following loop :


for(int i=0;i<OrdersTotal();i++)

      if((order_ticket=OrderGetTicket(i))>0)

...



The Problem is, that my OrdersTotal() call allways returns zero.


Does anyone know why this happens?


Thanks for help,


Filip



 

i Got it... the code posted in this thread : https://www.mql5.com/en/forum/5009 is working like a charme for me ;)


regards,


Filip

How to delete pending order?
How to delete pending order?
  • www.mql5.com
If there is an open order and a pending order, I want to delete this pending order.
 

Oh that. Good for you that it help you.

By the way,

1. For next time, would you please use SRC button to post the codes, it will make much easier for others who trying to help you, reads your codes.

 

2. In MT5/mql5, there are differences when we call position, orders and deal. Please read this article for clarity : Orders, Positions, and Deals in MetaTrader 5.

Reason: