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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        52 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        38 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        99 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        60 views
        0 likes
        Last Post PaulMohn  
        Working...
        X