One order by one pair

 

Hello guys,

i have this,

OrderSend(Symbol(),OP_SELL,lotesell1,Ask,3,stopsell,Bid-35*Point);

and this opens a lot of ordens, i want to open one order by one pair and i have no ideia how i can do that :s

can you help me ?

Thanks everybody.

 
You need a variable that gets set when you have placed an order and unset when the order is closed . . . . then you check this variable before you place an order . .
 
vinicin22:
and this opens a lot of ordens, i want to open one order by one pair and i have no ideia how i can do that :s
Count the number of open orders and don't open another.
int nOrders=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.
    ){
      nOrders++;
    }
if (nOrders == 0){ time to open
Reason: