- Does NT accept to open and reverse position, under unmanaged approach ONLY with OrderAction.Buy and OrderAction.Sell ?, I mean: if I could code it, will NT allow this without any error? I wouldn't care much not having a flat position until ExitOnClose
- If I use just OrderAction.Buy and OrderAction.Sell, once the position has been exited and begins to open the new one, the Market.Position is updated immediately from its old status ? Within the OnExecution() method, I'd like to know the internal logic of NT handling the fills and updating Market.Position and Position.Quantity after fills
Allow me explain with this sample:
protected override void OnExecution(IExecution execution) { if (lEntryOrder != null && lEntryOrder == execution.Order) { if (lEntryOrder.OrderState == OrderState.Filled || lEntryOrder.OrderState == OrderState.PartFilled || (lEntryOrder.OrderState == OrderState.Cancelled && lEntryOrder.Filled > 0)) { if (Position.MarketPosition == MarketPosition.Flat || Position.Quantity == 0 ) { // Do your stuff if flat } } } }
Besides the answers, any ideas or suggestions for experience will be highly appreciated.
Comment