Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help with AddDataSeries using a different date range for each instrument

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

    Need help with AddDataSeries using a different date range for each instrument

    Hello,


    I have 49 instruments that i would like to run in the Strategy Analyzer using my custom built strategy hard coded script. I understand that I can do batch processing using my instrument list. However, my issue is that I do not understand how to “ninjascript” each “data series” with a different backtest date.


    For example i only want “TSLA” backtested on 01/14/2019 while “MU” backtested on 08/15/2019 both using just one strategy. I don’t need both instruments tested on the same day.


    The code below is incorrect but im lincluding for demonstration purposes:


    AddDataSeries(“TSLA” BarsPeriodType.Minute,

    1,

    BarsPeriodType.Range,

    01/14/2019 - 01/14/2019

    );


    AddDataSeries(“MU” BarsPeriodType.Minute,

    1,

    BarsPeriodType.Range,

    08/15/2019 - 08/15/2019

    );

    #2
    Hi, thanks for your note. Welcome to the NinjaTrader forum.

    You would need to select a different time interval, there's no way to programmatically add a specific amount of data. One way around this would be to run the strategy over a time period that encompasses all of the dates you need and only analyze the trades that fall within the desired date range.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X