Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Walk Forward and Optimization clarification needed

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

    Walk Forward and Optimization clarification needed

    Hello Ninjatrader Team,
    When I run Walk Forward with the settings Optimization Period (days) =1 and test period (days) =1 . I assume that it will optimized one day and test on the next day right? However When I look at the Trades in Ninjatrader I see that trades are executed on other days as well. Can someone clarify to me what is going on.

    I posted 2 pictures
    Attached Files

    #2
    Hi wallsteetking,

    Unfortunately this is a current limitation with walk forward tests.

    When running walk forwards with the FOREX session template (or similar), each walk forward period may double count trades on "transition" dates.

    Example scenario:
    First period is 1/29 to 2/25. Second period is 2/26 to 3/25.
    First period counts trades from 1/28 to 2/26.
    Second period counts trades from 2/25 to 3/26.

    There is an overlap of two days of 2/25 and 2/26 being double counted between each walk forward period.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      so how can I reproduce what ninjatrader is doing right now? Lets say I want to go live hypothetically on July 27,2012 trading the e-mini on 24-7 template. when would I optimize the data??( 12 midnight??? ) Do i optimize one day or 3 days. my goal is to be as close as possible to what ninjatrader is doing so that when I do go live I can have the same results.

      Comment


        #4
        Hello wallstreetking,

        Please note that you should expect differences when running a strategy in the Strategy Analyzer compared to running a strategy live on real-time data. Please see the link below for more information.


        You can optimize the strategy at the dates you like. When you perform a walkforward test, the strategy will be optimized on the first data set. Subsequently the strategy will run on the second data set using the optimized parameters. More information and a video can be found at the link below.

        Comment


          #5
          "When running walk forwards with the FOREX session template (or similar), each walk forward period may double count trades on "transition" dates."

          Is it true that it depends on the session template? only happen on 24/7 session?

          Comment


            #6
            Hi millridge,
            Yes, this limitation with walk forward tests is only seen with session templates that cross midnight (begin on one day and end on another).
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RyanM View Post
              Hi millridge,
              Yes, this limitation with walk forward tests is only seen with session templates that cross midnight (begin on one day and end on another).
              Hi Ryan, given your description of the limitation, I created a new session template which seems to solve it. Could you verify that this is a valid workaround to avoid overlapping trades in the walk forward results?

              The template goes from 12:00 AM to 11:59 PM on the same day for 7 days. My strategy requires a look-back across all trades all the time. If I need to 'exit on close' then I write the code into my strategy to handle it.



              Thanks -Dave

              Comment


                #8
                Dave,

                That looks like it would work. You would also want to set the time zone to your local time zone.
                Adam P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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