Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Any example to inherit from an existing indicator?

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

    Any example to inherit from an existing indicator?

    HI folks,

    I am looking for an example of making an indicator by inheriting from an existing one.

    The one I want to inherit from is the ZigZag indicator, which takes one parameter - the deviation points - as a fixed value. This value is an input property.

    What I want to do is to inherit from the calculation of ZigZag, and at the same time, I add one new option - the number of bars - in its property page. My intention is to use ATR(nbars) to make the deviation points dynamic. Anytime, the max of ATR and the fixed deviation value is used to calculate the ZigZag points.

    Thank you very much!


    Best Regards
    David

    #2
    NinjaScript development doesn't really work that way.

    There are impediments to inheritance, especially with indicators, probably
    due to the auto-generated NinjaScript code at the bottom of the file.

    I've never seen an example of what you seek.

    You're much better off making a copy of @ZipZag.cs, renaming the
    class inside of it, then modifying it to suit your needs.
    Last edited by bltdavid; 08-28-2020, 10:22 PM.

    Comment


      #3
      There is such an example in Ninjascript launchpad. Ninjalaunchpad.com

      In the tutorial, there are 2 indicators. The second indicator is made to read values from the first indicator.

      Comment


        #4
        Hello David,

        As a heads up, indicators extending other indicators is not supported by NinjaTrader support.
        This may lead to issues with the auto generated code added when compiling.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        344 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        557 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X