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

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

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

        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]


            BertrandNinjaTrader Customer Service

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

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

                    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 gravdigaz6, Yesterday, 11:40 PM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by MarianApalaghiei, Yesterday, 10:49 PM
                      3 responses
                      10 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by XXtrader, Yesterday, 11:30 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post XXtrader  
                      Started by love2code2trade, 04-17-2024, 01:45 PM
                      4 responses
                      28 views
                      0 likes
                      Last Post love2code2trade  
                      Started by funk10101, Yesterday, 09:43 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post funk10101  
                      Working...
                      X