Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exception when using Attach order to custom Indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Exception when using Attach order to custom Indicator

    not sure what is wrong in my indicator but Attach order to custom indicator fail while to build in indicator seem to work fine, the trace does not show anything specific to my code so I am not sure.

    Attached full trace:

    2016-01-10 20:33:40:139 *************** unhandled exception trapped ***************
    2016-01-10 20:33:40:139 Object reference not set to an instance of an object.
    2016-01-10 20:33:40:140 System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.Gui.NinjaScript.IndicatorTrackingPrope rties.OnSelectionChanged(Object sender, SelectionChangedEventArgs e)
    at System.Windows.Controls.SelectionChangedEventArgs. InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    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.RaiseEvent(RoutedEventArg s e)
    at System.Windows.Controls.ComboBox.OnSelectionChange d(SelectionChangedEventArgs e)
    at System.Windows.Controls.Primitives.Selector.Invoke SelectionChanged(List`1 unselectedInfos, List`1 selectedInfos)
    at System.Windows.Controls.Primitives.Selector.Select ionChanger.End()
    at System.Windows.Controls.Primitives.Selector.Select ionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
    at System.Windows.Controls.Primitives.Selector.OnSele ctedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.OnPropertyChanged( DependencyPropertyChangedEventArgs e)
    at System.Windows.FrameworkElement.OnPropertyChanged( DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.NotifyPropertyChan ge(DependencyPropertyChangedEventArgs args)
    at System.Windows.DependencyObject.UpdateEffectiveVal ue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
    at System.Windows.DependencyObject.SetValueCommon(Dep endencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
    at System.Windows.DependencyObject.SetValue(Dependenc yProperty dp, Object value)
    at NinjaTrader.Gui.NinjaScript.IndicatorTrackingPrope rties.OnLoaded(Object sender, RoutedEventArgs e)
    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.RaiseEvent(RoutedEventArg s e)
    at System.Windows.BroadcastEventHelper.BroadcastEvent (DependencyObject root, RoutedEvent routedEvent)
    at System.Windows.BroadcastEventHelper.BroadcastLoade dEvent(Object root)
    at MS.Internal.LoadedOrUnloadedOperation.DoWork()
    at System.Windows.Media.MediaContext.FireLoadedPendin gCallbacks()
    at System.Windows.Media.MediaContext.FireInvokeOnRend erCallbacks()
    at System.Windows.Media.MediaContext.RenderMessageHan dlerCore(Object resizedCompositionTarget)
    at System.Windows.Media.MediaContext.RenderMessageHan dler(Object resizedCompositionTarget)
    at System.Windows.Media.MediaContext.Resize(IComposit ionTarget resizedCompositionTarget)
    at System.Windows.Interop.HwndTarget.OnResize()
    at System.Windows.Interop.HwndTarget.HandleMessage(Wi ndowMessage msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Interop.HwndSource.HwndTargetFilter Message(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)
    Attached Files

    #2
    Hello Raditz,

    Thank you for your post.

    Can you attach the indicator to your response so we may investigate this matter further?

    You can attach your indicator to your response by going to Tools > Export > NinjaScript > add > select the check box next to your indicator > OK > Export. The file will be located under (My) Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript.

    Comment


      #3
      Minimal indicator attached

      Removed all the code from the indicator and still cannot attach the indicator to an order, get the same exception
      Attached Files

      Comment


        #4
        Hello Raditz,

        I am getting the same message. I am experimenting with the code to try to find what it is about it that causes this. If you have found a bug, I will report it once I have isolated it.

        Thank you for bringing this to our attention. I will update this thread with any information I find.

        Comment


          #5
          Raditz,

          It is the name of the indicator. If you remove the space before the name it will work.
          For example:
          Code:
          Name = "Navi_PM";
          The indicator Wizard prevents you from using spaces in the name as it can cause issues. I will check with development on this specific item though just to be sure.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by carnitron, Today, 08:42 PM
          0 responses
          5 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Today, 07:51 PM
          0 responses
          6 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,974 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          8 views
          0 likes
          Last Post rbeckmann05  
          Started by rhyminkevin, Today, 04:58 PM
          4 responses
          58 views
          0 likes
          Last Post dp8282
          by dp8282
           
          Working...
          X