- OnOrderUpdate() does not provide an update for the most current state of an order but instead provides you an event notifying you of each state change in sequence and the relevant information on the order at the time the state changed
- OnExecution() will be triggered always after OnOrderUpdate()
- CRITICAL: If you want to drive your strategy logic based on order fills you must use OnExecution() instead of OnOrderUpdate(). OnExecution() is always triggered after OnOrderUpdate(). There is internal strategy logic that is triggered after OnOrderUpdate() is called but before OnExecution() that can adversely affect your strategy if you are relying on tracking fills within OnOrderUpdate().
Thus, it seems that if you're monitoring the state an order, OnExecution(), using the correct IObject property, is the method that guarantees to have the most current and reliable state for internal strategy logic. With that said I have a big doubt:
- Is there some case where actually will be better OnOrderUpdate() than OnExecution() ?
- Why would it be important to know the state change in sequence, where it seems that having the most current state is more important ?
Comment