It reports the Direction ie the MarketPosition but does NOT report the tradeSize or the price?
I have also tried this using OnExecutionUpdate and get the same behaviour.
Can support help me here as I am completely lost.
I should also add that when I designed the indicator using simulated data it worked just fine - turned it off and on - and it no longer works , so I am baffled.
private void OnPositionUpdate(object sender, PositionEventArgs e)
{
if(ShowPrints)
NinjaTrader.Code.Output.Process(string.Format(" OnPosition1 - Instrument: {0} MarketPosition: {1} AveragePrice: {2} Quantity: {3}",
e.Position.Instrument.FullName, e.MarketPosition, e.AveragePrice, e.Quantity), PrintTo.OutputTab2);
if(e.MarketPosition == MarketPosition.Flat)
{
Direction = 0;
inTradeSize = 0;
MyEP1 = 0;
}
if(e.MarketPosition != MarketPosition.Flat)
{
inTradeSize = e.Quantity;
MyEP1 = Instrument.MasterInstrument.RoundToTickSize(e.AveragePrice);
}
}

Comment