order count same pair only.. how?

 

hello guys, need little help here..

I'm not a programmer and having a little issue with this code;

int cnt = OrdersTotal();

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

{

if (!(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))) continue;

if (OrderSymbol() != Symbol()) continue;

//if (OrderMagicNumber() != Magic) continue;

if (OrdersTotal() != 1) continue;

The last line >> if (OrdersTotal() != 1) continue; << say if my total order = x, then continue..

Question: How to I tweak this code to do: if my total order IN THE SAME CURRENCY PAIR ONLY = x, then continue...

appreciate everyone..

regards

 

  1. if (OrdersTotal() != 1) continue;
    What are you thinking here? What does other open orders on other charts have to do with anything.

  2. order count same pair only.. how?
    int ordercount=0;
        for(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 my pair.
            ordercount++;
        }
Reason: