I'm trying to utilize the CreateOrder() and StartAtmStrategy() methods. I created an AddOn order and call it. I want to use a stop order entry at a set price. How do I set the price for the initial Stop Order price?
public static void ExecuteTrade(double entryPrice, double stopPrice, double targetPrice)
{
lock (Account.All)
account = Account.All.FirstOrDefault(a => a.Name == "SimTest");
entryOrder = account.CreateOrder(
Cbi.Instrument.GetInstrument("NQ SEP24"),
OrderAction.Sell,
OrderType.MIT,
OrderEntry.Manual,
TimeInForce.Day,
1,
targetPrice,
stopPrice,
string.Empty,
"Entry",
Core.Globals.MaxDate,
null
);
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy("Test", entryOrder);
Output.Process($"ExecuteTrade {LN()}", PrintTo.OutputTab1);
}

Comment