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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        61 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X