I have come across an discrepancy with between the OnExecutionUpdate() and the NT8 documentation.
Documentation states that the marketPosition value passed into OnExecutionUpdate will be the market position After the Execution.
It seems when an "Exit on session close" order is found (execution.order.name == "Exit on session close") the marketPosition is other than MarketPosition.Flat. It gives MarketPosition.Long when exiting a Short Position and MarketPosition.Short when exiting a Long Position.
Thanks,
Comment