Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by TraderBCL, Today, 04:38 AM
        0 responses
        2 views
        0 likes
        Last Post TraderBCL  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X