Ticket not selectable for position

chinaski
1157
chinaski  

Hello,

i have the problem, that a just opened position by 

CTrade::Buy

is not selectable

PositionSelectByTicket(ticket)

The position is opened, ret result is 10009.

The ticket is valid but 

PositionSelectByTicket

fails.

Why ?

Thank you

chinaski
1157
chinaski  

This workaround seems to solve this:

 CTrade td;

 if(td.Buy(vol,symbol,price,0.0,0.0,"") == true)
 {
	 ulong ticket  =td.ResultOrder();
	 if(ticket > 0)
	 {
		int count=0;
		while(PositionSelectByTicket(ticket) == false && count < 100)
		{
			Sleep(1);                
			++count;
		}
	 }
}