Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing User Parameters

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

    Accessing User Parameters

    I want to color price bars based on the value of the RSI. How should I construct the test to see if the value of the RSI is above or below the parameters the user selected for the upper and lower values? What variables hold the user selections for upper and lower parameters?

    #2
    Hello,

    These are found if you click on the grey Variables near the top of the code or the Properties box near the bottom. They are light grey.
    DenNinjaTrader Customer Service

    Comment


      #3
      Which Variable to Reference?

      This is the variables section -

      Code:
       
      #region Variables
      private DataSeries avgUp;
      private DataSeries avgDown;
      private DataSeries down;
      private int period = 14;
      private int smooth = 3;
      private DataSeries up;
      #endregion

      This is the properties section -

      Code:
       
      #region Properties
      /// <summary>
      /// </summary>
      [Browsable(false)]
      [XmlIgnore()]
      public DataSeries Avg
      {
      get { return Values[1]; }
      }
      /// <summary>
      /// </summary>
      [Browsable(false)]
      [XmlIgnore()]
      public DataSeries Default
      {
      get { return Values[0]; }
      }
      
      /// <summary>
      /// </summary>
      [Description("Numbers of bars used for calculations")]
      [Category("Parameters")]
      public int Period
      {
      get { return period; }
      set { period = Math.Max(2, value); }
      }
      /// <summary>
      /// </summary>
      [Description("Number of bars for smoothing")]
      [Category("Parameters")]
      public int Smooth
      {
      get { return smooth; }
      set { smooth = Math.Max(1, value); }
      }
      #endregion


      The RSI has two lines being drawn. The user can specify values for both the upper and lower lines. A gif of the settings that can be specifed by the user is attached.

      What variables would hold the value specified by the user for the upper and lower lines? What code would I use to test if the value of the RSI was above or below each of those two user specfied values.

      if RSI > ????????

      or if RSI <= ??????????

      Thanks
      Attached Files

      Comment


        #4
        drumholz, you could access those for example with this snippet call -

        Code:
         
        if (rsi > Lines[1].Value) ...
        This would access the second line's value, as the index is zero based...

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        36 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        14 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        19 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X