OrdersTotal() meaning

 

This should be an easy question:

Does the OrdersTotal() function return the number of open orders for whatever chart the EA is loaded on, or does it return the total amount for the account? I.E., If I have the same EA loaded on say 4 different charts, and only one of them launched orders, are the other EAs going to return OrdersTotal()>0 as well?

And, yes, i looked in the documentation, but it didn't specifically address this.

 

no, OrdersTotal() even on a chart without orders return the total orders in terminal

 
qjol:

no, OrdersTotal() even on a chart without orders return the total orders in terminal

No, OrdersTotal() return total all opening order (contents pending orders) in terminal (flatform).

int OrdersTotal( )
Returns market and pending orders count.

Ex: If you are open 1 buy order at EURUSD, and 1 sell order at GBPUSD, and 1 sell limit order at USDJPY.
==> Total=OrdersTotal();
==> //Return: Total=3

Good luck.
 
Total of all open (filled and pending) orders. That's why you must filter
    for(int pos = OrdersTotal() - 1; pos >= 0; pos--) if (
        OrderSelect(pos, SELECT_BY_POS)                 // Only my orders w/
    &&  OrderMagicNumber() == magic.number              // my magic number
    &&  OrderSymbol()      == Symbol() ){               // and symbol
 

Thanks

 
very informative i have confusion over OrdersTotal function and this discussion clears my concept too