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

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.
        BertrandNinjaTrader Customer Service

        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 RookieTrader, Today, 09:37 AM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by kulwinder73, Today, 10:31 AM
          0 responses
          4 views
          0 likes
          Last Post kulwinder73  
          Started by terofs, Yesterday, 04:18 PM
          1 response
          22 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by CommonWhale, Today, 09:55 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Gerik, Today, 09:40 AM
          2 responses
          7 views
          0 likes
          Last Post Gerik
          by Gerik
           
          Working...
          X