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

Properties

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

    Properties

    Why is it when I place the below code in Properties

    Code:
    [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]
    [Description([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Setup Look Back Bars"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])]
    [Category([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Parameters"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])]
    [Gui.Design.DisplayName([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"01. LookBack"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])]
    [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] lookbackbars
    {
    [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] LookBackBars; }
    [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] { LookBackBars = Math.Max([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], value); }
    } 
    [/SIZE][/FONT][/SIZE][/FONT]
    I get the error message "No overload for method 'tdbuyextendedsetup' takes '0' arguments". The error, though, is occuring in indicators which call values from this indicator.

    When I remove the above code, everything compiles...

    #2
    As soon as you created a new property for the indicator, you changed the calling signature for the indicator. Specifically, you increased the number of parameters by the number of new properties that you introduced, so any other indicator that calls the modified indicator has to be adjusted to call the modified indicator with the correct signature.

    Comment


      #3
      Kaywai, please make the changes suggested by koganam and see if that resolves the issue.
      AustinNinjaTrader Customer Service

      Comment


        #4
        Thanks Koganam & Austin! The indicator compiles now!

        The next question I have regarding this is:

        If the "lookbackbars" field can be manually changed, how do I get other indicators/strategies to use the changed field automatically?

        For example, the "lookbackbars" field is defaulted to "5". And if I adjust the code via the display screen to "4", how can I get the other indicators/strategies to automatically use the "4" instead of the default "5"?

        As a result of the changes I made below, all the indicators/strategies that call this indicator have to have "5" in the brackets immediately after the indicator. I was hoping it could use whatever number I decide in the indicator proper.

        Could you please advise?

        Regards

        Kay Wai

        Comment


          #5
          If it is a property, you just have to call the indicator with the value that you want. It will be automatically passed: that is the meaning of a property.

          From what you describe (as it seems that you have to put it in the brackets, when calling the indicator), it would appear that you are talking about a property. In that case, all you need to do is call the indicator with "4" instead of "5".

          Comment


            #6
            kaywai, unfortunately you'll have to edit all of your scripts manually and change the 5 to a 4 if you want them all to use a value of 4 from now on.
            AustinNinjaTrader Customer Service

            Comment


              #7
              cool. thx guys! appreciate your help

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ETFVoyageur, Today, 02:04 PM
              2 responses
              15 views
              0 likes
              Last Post ETFVoyageur  
              Started by mjbatts91, Today, 04:48 PM
              0 responses
              2 views
              0 likes
              Last Post mjbatts91  
              Started by 1001111, Today, 09:45 AM
              2 responses
              21 views
              0 likes
              Last Post 1001111
              by 1001111
               
              Started by cre8able, Today, 04:31 PM
              0 responses
              4 views
              0 likes
              Last Post cre8able  
              Started by leojimenezp, Today, 04:04 PM
              0 responses
              7 views
              0 likes
              Last Post leojimenezp  
              Working...
              X