Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Base Classes

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

    Indicator Base Classes

    I have created some base classes, that are derived from Indicator, to avoid code duplication. I wasn't able to make them abstract, but could make them virtual. The issue is that the base classes appear in the Indicators list. I could just duplicate the source code, but I naturally want to avoid that if I can.

    Thanks,
    Henry

    #2
    Hello Henry,

    Inheritance for indicators is not supported by NinjaTrader and can cause issues with the auto-generated code added by NinjaTrader.

    You could have static methods in a custom namespace and call the methods from indicators or strategies, and this would not cause issues with this.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      My base classes make use of protected class fields, properites and some abstract/virtual methods. What I'll do is duplicate the source code, but put it into a region so it is easy to identify and remove if Inheritence for indicators is ever supported. That would also make it easier to maintain for me as I will just copy and paste any modifications to what would ideally be the source code for the base class into the classes that use it.

      Thanks,
      Henry

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      666 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X