NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 07-26-2012, 03:24 PM   #1
wallsteetking
Member
 
Join Date: Jan 2011
Posts: 67
Thanks: 7
Thanked 1 time in 1 post
Default 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 Images
File Type: png 1 HELP.png (159.8 KB, 16 views)
File Type: png 2 Help.png (209.3 KB, 11 views)
wallsteetking is offline  
Reply With Quote
Old 07-26-2012, 03:27 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

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.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 07-26-2012, 06:29 PM   #3
wallsteetking
Member
 
Join Date: Jan 2011
Posts: 67
Thanks: 7
Thanked 1 time in 1 post
Default

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.
wallsteetking is offline  
Reply With Quote
Old 07-27-2012, 02:24 AM   #4
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,220
Thanks: 83
Thanked 333 times in 325 posts
Default

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.
http://www.ninjatrader.com/support/h...ime_vs_bac.htm

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.
http://www.ninjatrader.com/support/h...e_a_strate.htm
NinjaTrader_Jason is offline  
Reply With Quote
Old 08-09-2012, 06:53 AM   #5
millridge
Member
 
Join Date: Nov 2009
Posts: 61
Thanks: 2
Thanked 1 time in 1 post
Default

"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?
millridge is offline  
Reply With Quote
Old 08-09-2012, 07:08 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

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).
NinjaTrader_RyanM is offline  
Reply With Quote
Old 11-18-2012, 08:31 AM   #7
dave416
Junior Member
 
Join Date: Jul 2011
Posts: 20
Thanks: 3
Thanked 2 times in 1 post
Default

Quote:
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
dave416 is offline  
Reply With Quote
Old 11-18-2012, 10:17 AM   #8
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Dave,

That looks like it would work. You would also want to set the time zone to your local time zone.
NinjaTrader_AdamP is offline  
Reply With Quote
The following user says thank you to NinjaTrader_AdamP for this post:
Reply

Tags
optimization, optimize, trade trades, walk forward

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Walk Forward Optimization eleven Strategy Analyzer 11 12-16-2010 09:52 PM
Anchor Walk-forward Optimization shadowskill84 Strategy Analyzer 4 12-15-2010 10:40 AM
Walk Forward Optimization. Can't replicate lookOutBelow Version 7 Beta General Questions & Bug Reports 0 09-11-2010 11:41 PM
Walk forward optimization - is it rolling? stefy Strategy Development 5 06-09-2009 05:46 AM
Walk Forward Optimization JonesWooHoo Suggestions And Feedback 8 10-12-2007 04:16 AM


All times are GMT -6. The time now is 07:05 AM.