I'm having an issue exiting a long position and then entering a short position within the same bar (a few lines lower in code). The issue is after calling ExitLong(), my Position.MarketPosition is Long and my Position.Quantity is 1 (from the long entry).
After calling ExitLong(), I subsequently call EnterShort() but first check to see if Position is flat. My EnterShort() never gets called because at the time of the short entry, the position is long (even after ExitLong() has been called and executed).
What's going on? I'm assuming its an issue with order handling and perhaps I am not using the appropriate order handling properties in the Initialize method of the strategy.
Thanks!

Comment