Getting this annoying pop up Buy stop or Buy stop limit orders cant be placed below the market. (this can happen on bar update with fast moving prices,
I do handle the error in the ninjascript but need the pop up closed since this is an automated strategy.
this ninhatrader 8 code comes up with errors on Ninja 7
ControlCenter cc = NinjaTrader.Core.Globals.AllWindows.First(t => t is ControlCenter) as ControlCenter; if (cc != null) { cc.Dispatcher.InvokeAsync(() => { System.Windows.Controls.Button closeButton = cc.FindFirst("NTWindowButtonClose") as System.Windows.Controls.Button; if (closeButton != null) { System.Windows.Automation.Peers.ButtonAutomationPe er peer = new System.Windows.Automation.Peers.ButtonAutomationPe er(closeButton); System.Windows.Automation.Provider.IInvokeProvider invokeProv = peer.GetPattern(System.Windows.Automation.Peers.Pa tternInterface.Invoke) as System.Windows.Automation.Provider.IInvokeProvider ; if (invokeProv != null) invokeProv.Invoke(); } }); }
Comment