• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
      Patrick H.NinjaTrader Customer Service

      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 Botan626, Today, 04:43 AM
              0 responses
              1 view
              0 likes
              Last Post Botan626  
              Started by xsgex, Yesterday, 09:46 PM
              0 responses
              3 views
              0 likes
              Last Post xsgex
              by xsgex
               
              Started by Steve L, Yesterday, 09:36 PM
              0 responses
              4 views
              0 likes
              Last Post Steve L
              by Steve L
               
              Started by krugman25, Yesterday, 09:34 PM
              0 responses
              4 views
              0 likes
              Last Post krugman25  
              Started by indy73, Yesterday, 04:42 PM
              0 responses
              15 views
              0 likes
              Last Post indy73
              by indy73
               
              Working...
              X