How to know if a position is openning

 

Hi

Sometimes when opening positions with OrderSend function, it accepts the position and returns true, but it may take some times for the position to be opened and listed in open trades list,

could someone please tell me how we can know that there are some positions that are accepted but still waiting to be opened completely and listed ?

thanks

 
Mehdi_Sobhani:

Sometimes when opening positions with OrderSend function, it accepts the position and returns true, but it may take some times for the position to be opened and listed in open trades list,

could someone please tell me how we can know that there are some positions that are accepted but still waiting to be opened completely and listed ?

I have never seen a case where OrderSend() returned a ticket number (returned 'true' as u put it) and the order wasn't immediately available for selection in the order pool (I mean via code, not with a click of the mouse in the Terminal). Are u sure that's what happened? Maybe u had error 128?

 

Hi

Thanks Gordon

Yes I'm sure that it happens,

I have written an expert which has a loop that counts open positions, for example it needs to have 5 open position ( with specific Comment and MagicNO ) it work without any problem on demo account, but on real accounts which are slower, sometimes it takes 6, 7 or more positions instead of 5 positions .

 
Mehdi_Sobhani:

I have written an expert which has a loop that counts open positions, for example it needs to have 5 open position ( with specific Comment and MagicNO ) it work without any problem on demo account, but on real accounts which are slower, sometimes it takes 6, 7 or more positions instead of 5 positions .

I see. Show your code... You might have a bug.
 
Also when trading manually I have seen it,like closing a position which is accepted by server but the position remains in open trades lists and vanishes after even 1 minutes,
 
gordon:
I see. Show your code... You probably have a bug.

Sorry,
I think there are also some bugs in my code, I should read and correct them more,It's more probable that I'm wrong,
Reason: