I'm currently testing out a strategy using Market Replay and I'm using the following to open a new ATM order
entryOrder = account.CreateOrder(instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Automated, TimeInForce.Day, 1, 0, 0, string.Empty, "Entry", Core.Globals.MaxDate, null);
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("ATMBACKTEST", entryOrder);
This opens the order fine, at this point I want to enter the below if statement and run some logic but Position.MarketPosition is always "Flat", even when it's in a position.
If (Position.MarketPosition == MarketPosition.Flat)
{
//do some stuff here
}
else
{
// do this stuff
}
Is there another way I can do this? or is the above incorrect? Should Position.MarketPosition be updated or does this not happen in Market Replay?
Hopefully I've explained this correctly.
Many Thanks for your help
Andy

Comment