Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript generated code doesn't generate in second level inheritance

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

    NinjaScript generated code doesn't generate in second level inheritance

    It appears that the NinjaScript generated code only gets generated if the indicator inherits directly from the NinjaTrader.NinjaScript.Indicators.Indicator class. I have a complex indicator, which inherits from a module which itself inherits from Indicator. Everything works and compiles, however the NinjaScript generated code doesn't generate for the leaf class.

    The inheritance looks like this:
    Indicator -> MyMiddleware -> MyIndicator

    The code gets generated in MyMiddleware (because it directly inherits from Indicator) but it doesn't get generated in MyIndicator.

    Creating the NinjaScript generated code manually doesn't work, because the editor immediately removes the code.

    Any suggestions on how to approach this problem?

    #2
    Hello xsgex,

    Thanks for your post.

    The NinjaScript Editor will create the generated code for scripts inheriting from Indicator to create proper overloads. If you are inheriting from another class, we can expect that the code will not be generated. I may suggest to create a script in the AddOn folder that includes the code that would normally be generated from the NinjaScript Editor. (Don't create code in the AddOn namespace, just include the NinjaScript generated partial classes in each namespace.) This should allow you to compile with the code while not having the NinjaScript Editor remove it.

    Please let us know if this does not help resolve your inquiry.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X