Every once in a while the strategy aborts because of Order Rejected or "Unable to change order" and the strategy aborts.
The problem is that I don't get any error in OnOrderUpdate() and so I cannot manage it.
I see the reason of the rejection and I'll fix it but I don't understand what could be a reason for the error not to show up during OnOrderUpdate()
I often also get error "Unable to change order" and the reason is not apparent. Would you know of a common reason why in playback I could get Unable to Change Order ?
The code I use is
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
{
Print(" order.Time:" + order.Time + " OnOrderUpdate " + order.ToString() + " err" + error.ToString() + " time:" + time.ToString() + " natErr:" + nativeError);
}
Why I get the error and why I cannot catch it in OnErrorUpdate() ?
it prints:
Strategy 'ExecS01/342051783' submitted an order that generated the following error 'Order rejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.
Gio

Comment