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!
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
NinjaTrader
Bug with Walk-Forward Optimization
Collapse
X
-
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 appreciatedTags: None
-
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 FilesChelsea B.NinjaTrader Customer Service
-
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
-
NinjaTrader_ChelseaB Here is the result after stopping optimization (for some reason it does not show the parameters, I added everything correctly):
Comment
-
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
-
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
-
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+1
Comment
-
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
-
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 fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,404 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
95 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
8 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
159 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment