You will get the message in the picture.
The message seems to be wrong. The issue has nothing to do with the DisplayInDataBox property: it is due to an attempt to access the Bars object too early. And in any case, we can most assuredly set DisplayInDataBox from right there! The Wizard put it there.
We should have error messages that at least point to the real problem.
Trace:
====
2015-05-22 16:54:38:828 ERROR: Indicator 'WrongErrorMessage': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
2015-05-22 16:54:38:832 ERROR: Error on getting/setting property 'DisplayInDataBox' for NinjaScript 'WrongErrorMessage': Exception has been thrown by the target of an invocation.
2015-05-22 16:54:38:836 *************** unhandled exception trapped ***************
2015-05-22 16:54:38:836 'DisplayInDataBox' cannot be set from this state. Please see the Help Guide article on 'DisplayInDataBox' for more information.
2015-05-22 16:54:38:876 System.InvalidOperationException: 'DisplayInDataBox' cannot be set from this state. Please see the Help Guide article on 'DisplayInDataBox' for more information.
at NinjaTrader.NinjaScript.IndicatorBase.set_DisplayI nDataBox(Boolean value)
at NinjaTrader.NinjaScript.IndicatorBase.CopyTo(Ninja Script ninjaScript)
at NinjaTrader.Gui.NinjaScript.IndicatorRenderBase.Co pyTo(NinjaScript ninjaScript)
at NinjaTrader.NinjaScript.NinjaScript.Clone()
at NinjaTrader.Gui.NinjaScript.IndicatorRenderBase.Cl one()
at NinjaTrader.Gui.Tools.IndicatorSelector.<.ctor>b__ 8(Object selected)
at NinjaTrader.Gui.Tools.ObjectDialogViewModel`1.OnAd dItem(Object selected)
at NinjaTrader.Gui.Tools.ObjectDialogViewModel`1.OnAv ailableDoubleClick()
at NinjaTrader.Gui.Tools.ObjectDialog.OnAvailableDoub leClick(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Deleg ate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandle r(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(Dependency Object sender, RoutedEventArgs args)
at System.Windows.Controls.Control.HandleDoubleClick( Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Deleg ate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandle r(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(Dependency Object sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Deleg ate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandle r(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(Dependency Object sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedE ventArgs args)
at System.Windows.Input.InputManager.ProcessStagingAr ea()
at System.Windows.Input.InputProviderSite.ReportInput (InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.Repo rtInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.Filt erMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessa ge(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation( Object o)
at System.Windows.Threading.ExceptionWrapper.Internal RealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatch When(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Comment