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

Limited Number of Parameters

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

    Limited Number of Parameters

    Hello,
    I'm developing an indicator and I've just added another property parameter to my code. The software works fine with the initial value assigned to this new parameter. But, for some reason, it doesn't appear in the parameter list when I open the indicator. Notice that deleting any other parameter from my script, then, it appears in the indicator GUI. I've tried any combination, changed names, etc. but nothing worked for me. I need only four parameters in my indicator but it looks like my system is limiting me to three parameters only. What can I do?

    #2
    Post your parameter code section, so we may have a better chance of figuring out the issue.

    Comment


      #3
      Hello gofortips,

      Sledge is correct, we would need to review the Properties region of your code.

      Comment


        #4
        Hello,
        Below you can see the variables region from my script as well as my Properties region.
        I hope you could figure out what the problem is.
        Thank you for your help.


        #region Variables
        // parameter variables
        // ======================
        private int minimumNumberOfBarsToDrawAline = 15;
        private int numberOfBackBarsToAnalize = 40;
        private bool plotHistory = true;
        private bool plotIndicator = true;

        // User defined variables
        // ======================

        // Point parameters
        private DataSeries X;
        private DataSeries Y;
        private DataSeries S; // line slope
        private DataSeries Tag;
        private DataSeries LineStatus;

        // LineStatus possible values:
        private const double CONNECT_POINTS = 1.0;
        private const double CONNECT_NONE = 2.0;
        private const double CONNECT_UNDEF = 3.0;
        private const double VALID_LINE = 4.0;

        private double TagIndex;
        private int ii;
        private int jj;

        private bool PointsMustBeBelowTheLine;
        private bool PointsMustBeAboveTheLine;

        private double b;
        private double YOnTheLine;
        #endregion


        #region Properties
        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        [Description("")]
        [GridCategory("Parameters")]
        public int NumberOfBackBarsToAnalize
        {
        get { return numberOfBackBarsToAnalize; }
        set { numberOfBackBarsToAnalize = Math.Max(2, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int MinimumNumberOfBarsToDrawAline
        {
        get { return minimumNumberOfBarsToDrawAline; }
        set { minimumNumberOfBarsToDrawAline = Math.Max(3, value); }
        }

        [GridCategory("Parameters")]
        public bool PlotHistory
        {
        get { return plotHistory; }
        set { plotHistory = value; }
        }

        [GridCategory("Parameters")]
        public bool PlotIndicator
        {
        get { return plotIndicator; }
        set { plotIndicator = value; }
        }
        #endregion

        Comment


          #5
          Remove this line:


          Code:
          [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          That is preventing your first one to not show. You have removed the dataseries from the params section.


          Code:
          public DataSeries Plot0
                  {
                      get { return Values[0]; }
                  }

          Comment


            #6
            YES!!, you are right, everything is working fine now.
            By the way, I've intentionally deleted the Plot0 parameter. I have no Add command in the Initialize method.
            The indicator receives the data from the graph where it is applied.
            I know it's not the general way you explain how to use NinjaScript, but it works fine and all the commands in my script refers to the default input.
            Do you think this method can be problematic in some way?
            Thanks a lot for your help.
            Carlos

            Comment


              #7
              Originally posted by gofortips View Post
              Do you think this method can be problematic in some way?
              No, you should be fine.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              602 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              22 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              20 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Started by agclub, 04-21-2024, 08:57 PM
              3 responses
              17 views
              0 likes
              Last Post TradingLoss  
              Working...
              X