PositionSelectByTicket(ticket_id) fails


Hi Everyone,

I am having issues with the method


After I open a new position (ctrade.Buy)

and a few lines later call

bool res = PositionSelectByTicket(ticket_id);

it returns a false. But the position is sitll there and it is visible in the table.

Any ideas how I can work around this issue?

Thank you very much

i had to add Sleep(200) between placing a new order and PositionSelectByTicket...