After placing order, how long should I wait to be safe? (using sleep() function)

 
Hi Slawa,

Just wondering if 6 seconds wait after placing order is long enough (to get confirmation of order placed and see the order in the trade terminal) ? within endless loop this is code im using:

{
RefreshRates();
OrderSend(Symbol(),OP_BUY,Lots2,Ask,Slippage,Ask-StopLoss2*Point,OrderTakeProfit(),"",0,0,Blue);
Sleep(6000); // Wait 6 seconds
}

Thanks Slawa. Very much appreciated.

Regards

RJF
 
Once more. Delay should be between trade operations. Not after. Not before. BETWEEN.
Delay does not mean sleep. You can something calculate between trade operations. And before some operation check last trade time
#define DELAY_TIME 10000
static int last_trade_time=0;
...
... your calculations
...
   int pause=DELAY_TIME-(GetTickCount()-last_trade_time);
   if(pause>0) Sleep(pause);
   OrderSend(...)
   last_trade_time=GetTickCount();


I don't know about 6 seconds. But OrderSend in the endless loop is stupid example. Game for all money

Ask your broker about delays between operations. I repeate - there is no official prohibited time. It is broker's matter.