Is it still the recommended approach in OnOrderUpdate/ExecutionUpdate to reference orders by their name rather than by an object reference?
Such as in this example from from the UnmanagedStrategyTemplate?
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError) { // Assign Order objects here // This is more reliable than assigning Order objects in OnBarUpdate, as the assignment is not guaranteed to be complete if it is referenced immediately after submitting if (order.Name == "Short limit entry") shortEntry = order; else if (order.Name == "Long limit entry") longEntry = order; else if (order.Name == "StopLossLong") stopLossLong = order; else if (order.Name == "TargetLong") targetLong = order; else if (order.Name == "StopLossShort") stopLossShort = order; else if (order.Name == "TargetShort") targetShort = order;
Comment