Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to influence the Function Signature?

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

    How to influence the Function Signature?

    Hi,

    I'm building an indicator and I also like to use this indicator inside a strategy.
    Now I get all the values exported. However the order of the variables in the construtor changes every time I add a new variable??

    Example:
    1st version

    double myValue = JWR_Ind(int b1, int b2, int b3).PubValue[0]

    Now if I ad another variable say bool a. This variable is automatically added to the front in the function signature like this:

    double myValue = JWR_Ind(bool a,int b1, int b2, int b3).PubValue[0]
    I would like it to be added at the end. How do I do that?

    So that the method would look like:
    double myValue = JWR_Ind(int b1, int b2, int b3, bool a).PubValue[0]

    These functions are automaticcally created by Ninja in the Section:
    #region NinjaScript generated code. Neither change nor remove.

    What is the best practice to fix my function signature?

    Wessel

    #2
    Hi Wessel,

    This is the default behavior, and, unfortunately cannot be changed. The parameters will automatically reorganize alphabetically.
    TimNinjaTrader Customer Service

    Comment


      #3
      Sorry to piggy back on an existing thread but my question seems related ...

      How can I control which parameters appear in the function signature? For example, I have an indicator where I want users to select different color for candles/bars (I expose these color variables in Properties and they show up in the Indicators dialog). But, the value of the indicator itself does not depend on the colors users choose. So I would like it to not show up in the function signature.

      Is it possible?

      Comment


        #4
        CzPete, welcome to our forums and thanks for the post - you could unfortunately not control this, one workaround would be supplpying a second indicator used for programmatic calls where the visualization inputs are masked.

        Comment


          #5
          Thanks Bertrand. I was considering creating a second indicator as a backup plan ... It just became the main plan :-) Thanks for the clarification.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          662 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          376 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X