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

Update ADDDataSeries every new trading day.

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

    Update ADDDataSeries every new trading day.


    Hello,

    I have created a strategy that imports the instruments it will operate on from a .csv.

    Code:
    else if (State == State.Configure)
    {
    int k=1;
    foreach(string s in System.IO.File.ReadAllLines(StockList))
    {
    AddDataSeries(s,BarsPeriod,"Default 24 x 7");
    Print(s);
    dct.Add(k,s);
    k++;
    }
    }
    Every day the instruments.csv file changes and I have to reload the strategy, is there a way for it to automatically update with login and import the new instruments?

    Thank you

    #2
    Hello lju45,

    Dynamically adding series is not supported by NinjaTrader.

    This means using variables for parameters in the AddDataSeries call is not supported and also means calling AddDataSeries in a branching command is not supported.

    From the help guide:
    "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by selu72, Today, 02:01 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by WHICKED, Today, 02:02 PM
      2 responses
      12 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by f.saeidi, Today, 12:14 PM
      8 responses
      21 views
      0 likes
      Last Post f.saeidi  
      Started by Mikey_, 03-23-2024, 05:59 PM
      3 responses
      51 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by Russ Moreland, Today, 12:54 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Erick  
      Working...
      X