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

Bar Index resets to 1 on Walk Forward (Strategy Analyzer)

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

    Bar Index resets to 1 on Walk Forward (Strategy Analyzer)

    Hi - I have a strategy that factors in the bar index via CurrentBar. In the Strat Analyzer this works great for a standard optimization - CurrentBar increments by 1 and I have a complete view of how many bars have elapsed since the strategy started. However on a walk forward analyis, the bar index resets back to 1 on the walk forward window, thus skewing the optimization that came before it.

    Short of creating my own custom index in my strategy, is there a way to determine how many bars have elapsed since the start of the stragy, and not just the start of the walk forward window? I'd like to track total number of bars from the start of the optimization to the end of the walk forward window.

    #2
    Hello dave416,

    For each iteration of a walk forward, this is a new test. The time period thats being tested will change, but the new test is starting at the begging.

    Can you further detail why you feel the value of CurrentBar should not reset on a new backtest?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Originally posted by NinjaTrader_ChelseaB View Post

      For each iteration of a walk forward, this is a new test. The time period thats being tested will change, but the new test is starting at the begging.

      Can you further detail why you feel the value of CurrentBar should not reset on a new backtest?
      Well generally speaking, all the conditions present during optimization should be present, including data points. When things change arbitrarily during the walk forward window, results are skewed.

      Specifically, the bar indexes should not change or reset - simply by virtue of the fact that phenoenon doesn't happen during optimization, but also because there are strategies that could depend on this, including mine.

      Put another way, if the Wallk Forward feature didn't exist in Ninjatrader, a user would need to do a regular optimization on a date range in the past, set those parameters in the strategy, then perform a back test on an extended date range in the future - I would expect the Walk Forward feature to behave in the same way. \

      I hope that helps!

      Comment


        #4
        Hello dave416,

        I'm not sure that I am understanding. If a user did regular backtests on different date ranges, each backtest would have CurrentBar start at 0 for whatever is the first bar in that date range.

        Could further clarify what I'm not understanding. How would this be different than what the optimization is doing?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        7 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        12 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        13 views
        0 likes
        Last Post bltdavid  
        Working...
        X