Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 jackiegils, Today, 11:05 PM
        0 responses
        5 views
        0 likes
        Last Post jackiegils  
        Started by cre8able, Yesterday, 09:15 PM
        2 responses
        17 views
        0 likes
        Last Post cre8able  
        Started by Trader146, Today, 09:17 PM
        0 responses
        9 views
        0 likes
        Last Post Trader146  
        Started by ttrader23, 05-08-2024, 09:04 AM
        9 responses
        43 views
        0 likes
        Last Post ttrader23  
        Started by ZeroKuhl, Yesterday, 04:31 PM
        8 responses
        46 views
        0 likes
        Last Post ZeroKuhl  
        Working...
        X