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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X