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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X