How to handle Robot restart
How to handle Robot restart
07 May 2013, 12:38
Hello Support, This is possibly a bug.
If a robot creates some pending orders then it gets stopped without canceling his pending orders.
Then it gets restarted, when the pending orders he created previously gets opened the OnPositionOpened doesn't get called.
How can one handle resumling a robot after being stopped without loosing control over his positions?
Replies
hichem
07 May 2013, 16:24
RE:
You can use Labels for this. Use the OnTick event to check for the positions with the label set when the order was created. Please see the examples here.
That solve how to retrieve the previously created pendingOrders (by label). If those PendingOrders get opened, when their PriceLevel hit, the OnPositionOpened dosn't get called. How to know if a pending order has been opened ?
@hichem
cAlgo_Fanatic
07 May 2013, 16:35
If the label of the position is the same as the label of the pending order it means the pending order was filled.
@cAlgo_Fanatic
cAlgo_Fanatic
07 May 2013, 16:17
You can use Labels for this. Use the OnTick event to check for the positions with the label set when the order was created. Please see the examples here.
@cAlgo_Fanatic