Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataSeries as User Input

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

    DataSeries as User Input

    Is it possible to use a DataSeries as a user input?

    Ex.

    Code:
    private DataSeries myprice = (High+Low)/2;
     
    #region Properties
     
    public DataSeries MyPrice
    {
     get{return myprice}
     set{myprice=value}
    }
     
    #endregion

    #2
    Not sure what you are trying to do. How would using a DataSeries be any different than using a double?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Perhaps this will help. I want the user to input whatever price/formula they would like to calculate a SMA.

      Code:
      private DataSeries myprice = (High+Low)/2;
      
      protected override void OnBarUpdate
      {
       avg=SMA(myprice,20);
      }
       
      #region Properties
       
      public DataSeries MyPrice
      {
       get{return myprice}
       set{myprice=value}
      }
       
      #endregion

      Comment


        #4
        That wouldn't work. DataSeries are linked to bars. How would you move to the next bar slot? How would they input in more than one value?

        If you want them to have a whole bunch of numbers, I suggest you just read it from a text file.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        630 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        566 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X