I rely on the OnExecution event to know when my position is closed. My question is:
a. Since for the same order can be several OnExecution events (in case of a partial fill) how do I know at the OnExecution event that all parts were filled and my order is completely executed? For example, if I have an exit order with a size of 10 and it was executed with partial fills of 6, 3 and 1, in that order, I want to know at the last execution of 1 that it was the last one.
b. In case I have several partial fills how do I know my FINAL average fill price?
In the example above if the price was 10, 11 and 9 then the average price is (6 X 10 + 11 X 3 + 1 X 9) / 10 = 10.2
Thanks
Comment