Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddChartIndicator Using Indicator with a Custom Type Convertor

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

    AddChartIndicator Using Indicator with a Custom Type Convertor

    I have several indicators that have a custom TypeConvertor. When I add the one of these indicators to a strategy using AddChartIndicator and then open up the indicator properties window, I get an "object not set to an instance of an object" error. I have been able to identify the issue is because all the items in the PropertyDescriptorCollection are null. I assume this is happening because only the plot properties are included in the properties dialog when using AddChartIndicator.

    I am able to resolve the issue by iterating over the PropertyDescriptorCollection and checking if any item is null, before returning the PropertyDescriptorCollection.

    Code:
    foreach (var item in propertyDescriptorCollection)
    {
      if (item == null) return null;
    }
    
    return propertyDescriptorCollection;
    I thought you might want to include something in the help guide on TypeConvertors that warns other users of this potential issue and the way to address it.

    Thanks, Greg
    The Trading Mantis
    NinjaTrader Ecosystem Vendor - The Trading Mantis

    #2
    Hello Greg,

    Thanks for your suggestion.

    I'll see if we can fit a note into the existing sample.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X