One order by one pair

To add comments, please log in or register
Vinicius Gonzalez
17
Vinicius Gonzalez  

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.

Simon Gniadkowski
17644
Simon Gniadkowski  
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 . .
whroeder1
17954
whroeder1  
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
To add comments, please log in or register