Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding and Changing parameters in the Indicators windows

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

    Adding and Changing parameters in the Indicators windows

    Hello again,

    In the indicators window, in the right side, i'd like to see some variables that i'm not seeing although i coded them in the "#region Variables" section.

    My #region Variables:
    #region Variables
    // Wizard generated variables
    private int myInput0 = 1; // Default setting for MyInput0
    private bool commercials = true;
    private bool nonCommercials = false;
    private bool other = false;
    private DateTime date;
    #endregion

    When plotting, in the variables window I only see "myImput0".
    How could I see commercials, nonCommercials, and other?

    thanks,
    jr.

    #2
    Hi, you want to set those up as user input paramters as explained in this tip - http://www.ninjatrader-support2.com/...ead.php?t=5782

    Comment


      #3
      Do the same apply if I want to draw PlotCommercials, PlotNonCommercials and so on instead of only Plot0?

      thanks so much,
      jr.

      Comment


        #4
        Hi, you can add plots to your indicators with the Add() method - http://www.ninjatrader-support.com/HelpGuideV6/Add.html

        You can change the displayed name there, too - just make sure you also adjust the corresponding dataseries one under 'Properties'.

        Comment


          #5
          Fantastic!. It appears like i need and i plotted two indicators modifying the "properties" section.
          Now: how can i delete "myInput0"?. It doesn't compile if I comment it in this section and in the variables section.
          jr.

          Comment


            #6
            Great, if you don't need the myInput0 anymore comment this line out in your variables and also those entries in the 'Properties' section -
            Code:
            [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][Description([/SIZE][/FONT][/SIZE][/FONT][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])]
            [Category([/SIZE][/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"Parameters"[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])]
            [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] MyInput0
            {
            [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] { [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] myInput0; }
            [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] { myInput0 = Math.Max([/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Verdana], value); }[/FONT]
            }
            [/SIZE][/FONT][/SIZE][/FONT]


            Comment


              #7
              I had done that but i still have an error in the "NinjaScript generated code" section when compiling :-(
              It says (in spanish) that NinjaTrader.Indicator.xxx doen't contain a definition for "MyInput0"

              Comment


                #8
                Please click on the offending code line and comment it out, must likely you didn't comment out all the snippet contained in my prior post.

                Comment


                  #9
                  What and how I commented:
                  Variables:
                  //private int myInput0 = 1; // Default setting for MyInput0

                  Properties:
                  /*[Description("")]
                  [Category("Parameters")]
                  public int MyInput0
                  {
                  get { return myInput0; }
                  set { myInput0 = Math.Max(1, value); }
                  }
                  */
                  Error:
                  public jrCotixCBasico jrCotixCBasico(Data.IDataSeries input, int myInput0, bool percent, bool plotComm, bool plotNonComm, bool plotOther)
                  {
                  checkjrCotixCBasico.MyInput0 = myInput0; // HERE THE ERROR

                  Comment


                    #10
                    Please comment my snippet out like this below and it should compile -
                    Code:
                    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//[Description("")][/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//[Category("Parameters")][/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//public int MyInput0[/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//{[/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// get { return myInput0; }[/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// set { myInput0 = Math.Max(1, value); }[/COLOR][/SIZE][/FONT]
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//}[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]

                    Comment


                      #11
                      ˇit's ok! I can't understand why /* */ is not valid, although I don't matter. I'll post another question now.

                      thanks,
                      jr.

                      Comment

                      Latest Posts

                      Collapse

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