protected override void OnBarUpdate()
{
if (Toggle==true) return;
myAccount=ChartControl.OwnerChart.ChartTrader.Acco unt;
Order myEntryOrder = myAccount.CreateOrder(
Instrument, OrderAction.Buy, OrderType.Market,
OrderEntry.Manual,TimeInForce.Day,1,0, 0,string.Empty,String.Empty,
Core.Globals.MaxDate,null);
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(
ChartControl.OwnerChart.ChartTrader.AtmStrategy.Te mplate, myEntryOrder);
//myAccount.Submit(new [] {myEntryOrder});
Toggle=true;
}
as you see in the picture, when the order is submitted with
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(
ChartControl.OwnerChart.ChartTrader.AtmStrategy.Te mplate, myEntryOrder);
then it is stuck at initialized status.
but when the order is submitted with
myAccount.Submit(new [] {myEntryOrder});
then it is immediately filled.
more weirdly, when I tried to close those orders, they are stuck in "Cancel pending" status.
what is wrong?

Comment