MES 12/14/2021 1:48:50 PM bid<=enprice
MES 12/14/2021 1:48:50 PM activeAcc is S1Dec6729606
Indicator 'aaBarBO': Error on calling 'OnBarUpdate' method on bar 80: Object reference not set to an instance of an object.
Code producing above output:
Order createEntry_S(double enPrice, double bid, string orderName)
{
Print(sym + " " + Time[0].ToString() + " bid<=enprice");
Print(sym + " " + Time[0].ToString() + " activeAcc is " + activeAcc.Name);
return activeAcc.CreateOrder(
Instrument,
OrderAction.Sell,
OrderType.Limit,
OrderEntry.Manual,
TimeInForce.Day,
input_qty,
enPrice,
enPrice,
"",
orderName + DateTime.Now.ToString(),
DateTime.MaxValue,
null);
}
The code executes with no error on Sim101 account. But it cannot execute with the other account S1Dec6729606, which is a Topsteptrader-Ninjatrader account.
Thank you for any help.
Comment