when following the guidance in the documentation, valid non-null orders can get returned as null from GetRealtimeOrder(). This wrecks the strategy's order and position management of course.
I have had to check for this situation with the following code example.
private void UpdateOrdersToRealtime() // Update per strategy for any relevant Order objects used in the strategy { Print("UpdatingOrdersToRealtime()"); if (LE != null) { Print("transition "+LE.ToString()); Order o = GetRealtimeOrder(LE); if (o==null) Print("Transition returned null"); else LE = o; Print(LE.ToString()); } }
Cheers,
saltminer.