I've been using the Position.MarketPosition == MarketPosition.Long and Position.MarketPosition == MarketPosition.Short statements to take some actions once an order has been filled and that has been working.
However, there is one instance where it doesn't work and I'd like some suggestions. Since I have the strategy set to OnBarClose, if an order fills and hits the stop loss on the same bar, neither of those Position statements get executed.
Is there an alternative way of detecting when an order has been filled (managed and unmanaged)?
Comment