Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

constructos

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

    constructos

    Hi,

    I've created a custom indicator that allows quite a fair bit of user-input parameters. The thing is, most of it is visual related stuff like Start Time / End Time to draw Vertical Line, Text Color, etc.

    Is there a way I can prevent the NT compiler from including those parameters in the indicator's constructor?

    Example, constructor looks like this:

    Code:
    public myIndicator myIndicator(double decimalPoint, int fontOffset, string fontName, int fontSize, FontStyle fontType, int numberOfBars, int opacity, int startTime, int endTime)
            {
                return myIndicator(Input, decimalPoint, fontOffset, fontName, fontSize, fontType, numberOfBars, opacity, startTime, endTime);
            }
    I would just like this:

    Code:
    public myIndicator myIndicator(double decimalPoint, int numberOfBars)
            {
                return myIndicator(Input, decimalPoint, numberOfBars);
            }
    Thanks!

    -Nick
    Last edited by nicbizz; 11-06-2011, 02:38 PM.

    #2
    Nick, the only way you could take those out of the constructor is if you set the variables to some constant value.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin, the thing I don't understand is that I have some properties that I added in that are NOT in the constructor.

      For example:

      Code:
      private bool drawVLine = true;
      Code:
      #region Properties
              [Category("Visual")]
              [Description("")]
              [Gui.Design.DisplayName("Vertical Line Draw")]
              public bool VerticalLineDraw
              {
                  get { return drawVLine; }
                  set { drawVLine = value; }
              }
      There are other properties as well (int, double, etc.) that don't show up in the constructor. Does it have something to do with the fact that this example is labeled

      Code:
      [Category("Visual")]
      while the ones that appear in constructor are labeled

      Code:
      [GridCategory("Visual")]
      More importantly, does it matter if the labels are incorrect / different?

      Thanks

      Comment


        #4
        Nick, I'll have someone get back to you tomorrow with an answer to this.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Hello,

          Thanks for your patience.

          Please give this a try:

          Code:
                  [XmlIgnore]
                  [Category("Visual")] 
                  [Description("")]
                  [Gui.Design.DisplayName("Vertical Line Draw")]         
                  public bool VerticalLineDraw 
                  {             
                      get { return drawVLine; } 
                      set { drawVLine = value; }
                  }
          BrettNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          666 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          377 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X