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 NullPointStrategies, Today, 05:17 AM
    0 responses
    43 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    65 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X