I am trying to do the same for an indicator I am programming. It has chart buttons to submit new order and it uses the following code to apply the selected ATM strategy template to each new order. However, this creates multiple stops and targets for each new order unlike the Chart Trader method demonstrated in GIF.
My code below
NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrategySelector atmSelector = (Window.GetWindow(ChartControl.Parent).FindFirst(" ChartTraderControlATMStrategySelector") as NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrategySelector); myOrder = account.CreateOrder(Instrument, OrderAction.Buy, OrderType.Limit, OrderEntry.Manual, TimeInForce.Gtc, myQuantity, Math.Min(Low[1], GetCurrentBid() - 1 * TickSize), 0, string.Empty, "Entry", DateTime.MaxValue, null); if (atmSelector.SelectedAtmStrategy != null) { NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy(atmSelector.SelectedAtmStrategy, myOrder); }
Comment