Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug with Walk-Forward Optimization

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

    Bug with Walk-Forward Optimization

    Hello, I have a bug with Walk-Forward optimization. Whenever it gets about 3 quarters of the way, it just returns 2 results, and 1 weird thing that isnt an optimized timeframe but has a pnl? Not sure what is happening with this. Any help is appreciated

    #2
    Hello rbeckmann05,

    What settings are you using in the Optimize section? (Please include a screenshot)

    Are there errors appearing on the Log tab of the Control Center.

    Attached is a test script that demonstrates printing an instance id, parameters, and the start and end of the data to review each iteration.

    May I have you add these prints to your script as well, and then provide the output? (The parameters will need to be changed to the parameters of your script)
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, that sounds good, thank you. However going to be gone for lunch for a while, will get back to you ASAP with results!

      Comment


        #4
        NinjaTrader_ChelseaB Here is the result after stopping optimization (for some reason it does not show the parameters, I added everything correctly):Click image for larger version

Name:	Screenshot (72).png
Views:	74
Size:	652.4 KB
ID:	1292494

        Comment


          #5
          Hello rbeckmann05,

          Are there extra prints added for the CurrentBar number and Set Terminated?
          (These are not necessary at the moment and are preventing the prints we need from being in view)

          Please save the output from the output window to a text file and provide the text file. (Right-click > Save as)

          The one instance with print data in view appears to be processing data from Jan 22nd at 5:08 PM to Feb 1st at 3:55 PM.

          Likely, the strategy did not place any orders, which could mean no condition evaluated as true to call an order method, or that orders were submitted and ignored or cancelled.

          In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

          Below is a link to a support article that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


          Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

          Let me know if you need any assistance creating a print or enabling TraceOrders.

          Save the output from the output window to a text file and provide this with your reply.

          I'll be happy to assist with analyzing the output.​
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Ok, going to need a little bit to figure this stuff out and integrate. Thanks for the help so far, I'll get rid of the current bar print as well

            Comment


              #7
              NinjaTrader_ChelseaB Think youre right, heres the new output. Looks like when the averages are equal, it craps itself. Going to try a simple if (x == y), y = y+1Click image for larger version

Name:	Screenshot (74).png
Views:	68
Size:	700.1 KB
ID:	1292514

              Comment


                #8
                Actually, looking at it too, why does it say "start: 9/24/2023" and "end: 1/22/2024", even including the train/test day values, this does not make sense for my actual start/end dates? Could the lack of available data as the end of previous test becomes start of next be the issue, maybe data not loading?

                Comment


                  #9
                  Hello rbeckmann05,

                  There is an optimization period of 120 days and test period of 420 days.

                  Below is a link to the help guide on how a walk forward optimization works.


                  Without the requested output text file, I can guess is this is not the first iteration, and there are previous optimization and test periods before this.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  71 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  143 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  76 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  47 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  51 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X