Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest ignores part of data in daily data

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

    Backtest ignores part of data in daily data

    Hi,
    I have a strange problem. When running a strategy with daily bars it only start using data from a certain point. For instance if I run backtest from 2007 to 2011 it starts working only from 2009, and I'll get results for 2009-2011. It starts at different points with different instruments (for instance ZS start from 2009 and ES from the end of 2007).
    I made sure that all data is available and I can see it the chart tub.
    When trying to run it with data feed connected it gives an error of invalid symbol for the first symbol it needs to use, even though it works perfectly fine with a sample strategy.
    When I run it in debug mode I see that the first OnBarUpdate() iteration skips the previous data and just start from a certain point (in my example the first bar will be 12/31/2009 when the from value is 1/1/2007).

    Please tell me what I can possibly be doing wrong.

    #2
    orenshkol, would this be a multi series strategy you're using here? What would be the first date then that all your series would have surpassed the BarsRequired you have set from the UI (usually 20 bars)?

    Comment


      #3
      Thanks,
      I indeed had some multi-series piece of code buried in the strategy.

      Comment


        #4
        You're welcome, so with that being removed or BarsRequired adjusted to a lower value do you get a more consistent outcome now?

        Comment


          #5
          With the code removed. Changing BarsRequired didn't have any affect.

          Comment


            #6
            orenshkol,

            What time frame are you working with on the second test from Betrand?

            Are you running a CurrentBar check of any kind for the OnBarUpdate()?
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            69 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            42 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            24 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            27 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            54 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X