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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X