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

CS1501 Error

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

    CS1501 Error

    Hi All,

    I've developed an indicator that had three inputs, as defined under the 'parameters' region of NinjaScript code. I decided to add a forth, simply a boolean that changes indicator calculation methodology slightly.

    I've added the extra boolean to parameters. On generation of code I am now getting a CS1501 error... or "No overload for method 'mystrategy' takes '3' arguments'....

    It seems that me adding a 4th argument has screwed things up somehow... Any ideas...?

    Thanks

    #2
    Double click on the error. This will bring you to the erroneous code line where you need to stuff in a 4th parameter (the one you just added).

    Comment


      #3
      Hi Dierk,

      I'm getting the error (CS1501) three times. It's pointing to three totally innocuous lines of code. A variable definition, a line where I set a plot.pen.width and another line that simply has a '{' on it... All these lines of code were working fine before.

      I'm slightly worried that somehow, the NinjaTrader generated code at the bottom (the Don't touch bit) has become corrupted somehow... Is this possible...?? If so, is there a way of forcing NinjaTrader to regenerate it...??

      The reason I say this is, at one stage I tried to reverse what I had changed and I commented out the 4th parameter in the 'properties' region... and I got whole stack more errors, all this time within the NinjaTrader generated "don't touch" section...

      Any thoughts...?

      Comment


        #4
        NT will not created corrupted code in the section which you should not touch.

        Unfortunately we can provide support down to level of actually fixing customers coding bugs. I suggest giving it a fresh start and creating an indicator by the wizard with the right number of parameters and taking it from there.

        Comment


          #5
          Thanks Deirk. I rebuilt the indicator and strategy and it worked.

          However, in the process I noticed a couple of weird things. Maybe bugs in NT I'm not sure. But when I was definiing 4 inputs for an indicator, depending on the order in which I set those up (included int, double, bool), I noticed some inconsistencies in how NT defined the inputs under the 'properties section'... as an example, when I set up the bool to be the 4th input, it assigned the Math.Max() method to a boolean under 'properties'... which clearly gave an error.

          It might be me going crazy... but you might wanna just check it out.

          Many Thanks

          Comment


            #6
            It works as expected, meaning properties are generated in the order you enter them in the wizard.

            Comment


              #7
              Yes it wasn't the order that was the problem. It was that it assigned a Math.Max() method to a boolean...

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,404 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              7 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              159 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X