While it would be nice to assume my order is always filled… the reality is.. I might get a partial fill or no fill at all and need to manage my strategy based on the reality of the trade.
1. How can I properly find out if the order was filled, how many contracts and what price? Do I put this code in the OnPositionUpdate() event? or in the OnOrderUpdate() event?
I need this information to change the state of my strategy so it does the right thing next.
2. I also need to know how to cancel an order if it has been pending for too long. Then of course verify that it REALLY got cancelled.
Are there any "generic" code samples to help do this
kind of strategy?
Comment