When my long order gets filled, I submit a stop order.
protected override void OnOrderUpdate(IOrder order)
{
if (entryOrder != null && entryOrder == order)
{
//Print("ORDER"+order.ToString());
// Stoploss on fill
if (order.OrderState == OrderState.Filled)
{
entryOrder = null;
double stopLoss = (entry.m_exitType==ExitType.CHANDELIER) ? entry.m_stopLossCH: entry.m_stopLossSZ;
Print("StopLoss "+stopLoss+" "+stopLoss);
stopOrder = SubmitOrder(0, OrderAction.SellShort, OrderType.Stop, entry.m_tradeSize, 0, stopLoss, "", "PullBack");
prevExit= stopLoss;
}
}
...
(1) If the connection is lost when my long order gets filled, the stop order will not be submitted.
How can I recover from this situation and submit the stop order when the connection is back ?
(2) How does the managed approach deals with this situation ?
Thank you for the help !

Comment