Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Overloading

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

    Indicator Overloading

    I have an indicator with an unusually large number of input parameters having to do with things that will be irrelevant when called from a strategy. Is it possible to create one or more overloads with a public partial class so the indicator can be alternatively called without passing parameters or with only some small specified subset, like shown below, without interfering with NT 8's internal processing?

    Code:
         CurrentValue = MyIndicator()[0];
    
         CurrentValue = MyIndicator(a, b, c)[0];

    #2
    Hello caveat_lector,

    Thanks for your post.

    This would not be something that would be 100% supported, but you could try creating your own partial classes similar to what you see generated in the NinjaScript Generated Code section of an indicator.

    There may be issue taking this approach that we could not assist with, but if it works for your needs, great!

    If you have any new inquiries, please do not hesitate to open a new ticket.
    Attached Files

    Comment


      #3
      Thanks, I will give it a try.

      Comment


        #4
        For others who may be interested in this, I had no difficulty whatsoever making it work. However, unless your memory is better than mine, if you do this you probably should leave yourself remarks in the code to avoid wasting time figuring out why some simple future change "broke" your code.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X