I'm trying to pull out the execution price for specific orders through OnExecutionUpdate and I pulled the code directly from the help guide.
I'm receiving the "name "order" does not exist in current context" error.
private Order entryLongCeilingClose1A = null; protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time) { if (execution.Order.Name == "entryLongCeilingClose1A" && execution.Order.OrderState == OrderState.Filled) { entryLongCeilingClose1A = order; //this is where the error occurs } if (entryLongCeilingClose1A != null && entryLongCeilingClose1A == execution.Order) { exPriceClose1A = execution.Price; } }
exPriceClose1A = execution.Price;
Thanks
Comment