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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X