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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    60 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    43 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X