problem a lot of order

Back to topics list To post a new topic, please log in or register
avatar
39
ayoub 2015.08.02 12:58
 

I build an Expert ,but it open a lot of orders at the same time. How can I make it to open just one order.

please.

    void OnTick()
      {


     int total=OrdersTotal();

      for(int pos=0;pos<total;pos++)
     
      if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
      OrderProfit();
      int ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,"op buy/1",123,0,clrBlue);
      double a=OrderProfit();
      Comment("profit order select",a);
      }




avatar
Moderator
3418
GumRai 2015.08.02 13:11 #
 

Haven't you posted this code already?

Write your code to check for an open order and only open a new order if there are none. 

avatar
13001
Back to topics list  

To add comments, please log in or register