I am getting the following error. I know the meaning of it.
The error disables the strategy. Is there any way to just close open positions, cancel open orders and just continue with operations. Instead of having to enable the strategy again?
I tried the "RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors" but it seens it does not work. The code is:
(State == State.Configure)
{
//RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
}
SetStopLoss("SE11", CalculationMode.Price, High[1] + (Order01SL * TickSize), false);
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
{
if (order.Name == "Stop loss" && orderState == OrderState.Filled)
Stop = order;
if ("Stop loss" != null && Stop == order)
{
// Rejection handling
if (order.OrderState == OrderState.Rejected)
{
// Stop loss order was rejected !!!!
// Do something about it here
CancelOpenEntries();
CancelOpenOrders();
}
}
}
Comment