Right now, I am using the OnExecutionUpdate method to know when the position that was opened. Below is my pseudo code. My question is:
1) How do I know if that ordered that was filled is an order that filled all the positions. Like I want to make sure it was not a partials fill. Right now, I am checking by doing execution.Order.OrderState == OrderState.Filled. Is this a valid apporach?
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time) { string order_name = execution.Order.Name; bool is_filled = execution.Order.OrderState == OrderState.Filled ? true : false; if (is_filled) { if (order_name == my_active_signal_label) { attempt_counter += 1; } } }
Comment