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

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.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,229 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    441 views
    0 likes
    Last Post Delerium  
    Working...
    X