if (Position.MarketPosition == MarketPosition.Long && myLongTrigger) { exitOrder = ExitLong(0, DefaultQuantity, EXIT_CONDITION, LONG_POSITION); } if (Position.MarketPosition == MarketPosition.Short && myShortTrigger) { exitOrder = ExitShort(0, DefaultQuantity, EXIT_CONDITION, SHORT_POSITION); }
My problem is that the ensuing regular long triggers are not being called on the same candle. The reason for that is that I'm checking for the current market position.
if (myLongTrigger) { if (Position.MarketPosition == MarketPosition.Flat) { entryOrder = EnterLong(DefaultQuantity, LONG_POSITION); } } else if (myShortTrigger) { if (Position.MarketPosition == MarketPosition.Flat) { entryOrder = EnterShort(DefaultQuantity, SHORT_POSITION); } }
So this leads me to my question. Is there a way in NT7 to swap positions? Basically when I'm already in a trade and the inverse signal is being triggered I would like to exit and immediately drop into an inverse position. Hope this makes sense.
Perhaps I should instead check for entryOrder == null as opposed what I'm doing right now. I have seen both examples in the past and I prefer MarketPosition.Flat as my 'all clear' flag. But I'm open to any approaches that allow me to swap positions quickly within the same minute candle.
Thanks in advance.
Comment