Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add a new parameter to an indicator?

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

    #31
    Originally posted by NinjaTrader_Josh View Post
    Using a + sign in the Description field serves no purpose. Please do not use it.
    Please report a bug about that. It does serve a good and useful purpose -- readability of the source code.

    It is valid C#, and it makes the source much more readable -- a longer description can be kept on screen, rather than having to be one long line.

    I had noticed that other indicators do have their descriptions as one long line, and I wondered why. Now I know -- they are working around a bug.

    Another point -- I stumbled into this and never realized the problem it causes (failure to regenerate the code at the bottom). I tested it by seeing that the description was all there in the indicators dialog, and it looked fine to me.

    Something silently failing is Not Good, especially when it is Magic that we are not supposed to concern ourselves with anyway. Given all of the hassle documented in this thread, it would be Really Swell if the system gave a warning when it is unable to regenerate the code at the bottom. Please report a Request For Enhancement (or bug report, if you prefer) that it needs to do so.

    --EV

    Comment


      #32
      Thank you for the suggestion.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        Originally posted by NinjaTrader_Josh View Post
        Thank you for the suggestion.
        You are welcome.

        I am especially concerned about the Magic failing silently. I really do hope your developers take that seriously, and do provide a warning when the code at the bottom is not regenerated.

        --EV

        Comment


          #34
          Yet another bug in Description handling

          OK -- just what are the rules for the class description string?

          >> We established earlier in this thread that the string had to be just one string, not a string expression. The latter compiles and displays in the indicators dialog, but it prevents the automatic generation of code at the end. OK. At least no loss of functionality -- just readability.

          >> I assumed that the string could be any normal C# string. I was wrong. Characters like \r and \t get ignored in the output. They do not get displayed literally, and they do not have any carriage motion effect. There is no way to make the description anything other than all run together. Fine for a sentence, but I was trying for more. Oh, well ...

          >> Tonight I looked at another indicator of mine and discovered it has the same problem -- no auto code generation. It turns out that the build was choking on \" in the string.

          So just what are the rules? That string is not a C# string, but just quoted printing characters, excluding any characters that might be thought of as special?

          Is choking on \" a bug? I think so -- if it does not like that character, it should generate some sort of warning.

          I admit it is a low priority request, but it sure would be nice if that string could be any legal C# string expression, and the escape characters would work as C# intends them to (\" \r \t etc). This is, after all, a C# program, and one expects strings in a C# program to be C# string expressions. Failing that, please at least give us a diagnostic for anything that the build does not handle.

          --EV
          Last edited by ETFVoyageur; 01-01-2011, 06:20 AM.

          Comment


            #35
            Originally posted by ETFVoyageur View Post
            rt6176,

            Sorry -- did not work for me. I tried a totally vanilla custom indicator (except my name for the indicator). I compiled and verified that the generated code picked up myInput0. I then changed MyInput0 in the Properties region to be grid category "General" and recompiled. I even added a MyInput1, also in General, so I could be sure the generated code was re-generated. Sure enough, the newly generated code uses both MyInput0 and MyInput1

            --EV

            Hi ETFVoyageur,

            You are absolutely correct when working with a new indicator.

            NinjaTrader has successfully broken the ability to easily change or remove Parameter Variables.

            All grid categorys are now being built as "Parameters" no matter what you define them as.

            This really sucks!!!!

            How ever there is a work around.

            If you use an indicator created in a prior version of NT7 or even 6.5, The changing of grid category to "General" still works just fine.

            RJay
            Last edited by RJay; 01-01-2011, 09:25 AM.
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment


              #36
              Originally posted by rt6176 View Post
              Hi ETFVoyageur,

              NinjaTrader has successfully broken the ability to easily change or remove Parameter Variables.

              RJay
              My experience after all of the trials this thread suggests is that the main thing is avoiding doing anything that interferes with regenerating the code at the bottom. As far as I know, the main problem I had was the various ways in which the Description for the class can cause such a problem. I am especially concerned that it happens silently -- my only warnings, had I recognized what was happening, were broken compilations when I tried to remove or rename a parameter.

              I'm new to NT, and up until this discussion, I had not even been aware that the code was supposed to be regenerated -- I thought it was just boilerplate that the wizard created and their warning was so that you would be reluctant to make changes to it and risking breaking something. So when I had a compiler problem there, I just fixed it, not recognizing it was a symptom of their bug (failing to regenerate that code). Perhaps their warning comment that goes with that code should specifically say that the code is regenerated each time you compile.

              In my (limited) experience, which is all with the latest NT, it appears that I can add, remove, or rename parameters just fine -- but only as long as the code at the end is being regenerated.

              --EV

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              607 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              353 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              561 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X