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 09-23-2008, 05:46 AM   #1
PHOLAN
Member
 
Join Date: May 2008
Posts: 48
Thanks: 0
Thanked 0 times in 0 posts
Default Backtesting resolution

I have done intensive reading behind your backtesting philosophy. And while it makes sense for the most part, it errs by ommission.

Yes, it's true that live results will differ from backtest results. However, although you can not know the bid/ask during backtest, you can always come down to the lowest possible timeframe in order to provide a more accurate result.

Let me give you an example, I have a TF 3min strategy with a $280 TP and a $190 SL. My backtesting results are completely off becuase in those cases where a long bar is encountered, NT cannot discern what came first between the OHLC and mmy entry gets tagged as a loss instead of a profit. And, although market replay is a nifty feature, it does not work for log term backtest of a strategy.

A more accurate approach would be for a smart backtest, in which it looks at the bar and, if there is an entry, then default to 1 min data (for example) to see what happened inside it. That way, the problem with the OHLC would be avoided and more accurate results would be provided.
PHOLAN is offline  
Reply With Quote
Old 09-23-2008, 06:11 AM   #2
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,215
Thanks: 82
Thanked 332 times in 324 posts
Default

Hello PHOLAN,

I will forward your suggestionto our development team and ask them if they can add this to the list of future considerations for the software.

Thank you for your feedback.
NinjaTrader_Jason is offline  
Reply With Quote
Old 09-23-2008, 07:07 AM   #3
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

You can backtest intra-bar by utilizing a secondard more granular series. Here is a reference sample.

http://www.ninjatrader-support.com/v...ead.php?t=6652
NinjaTrader_Ray is offline  
Reply With Quote
Old 09-24-2008, 09:56 AM   #4
PHOLAN
Member
 
Join Date: May 2008
Posts: 48
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ray,

I thought of that. Will try it.
Hopefully V7 will include this as part of it's built in backtest.

Regards,


Philip
PHOLAN is offline  
Reply With Quote
Old 09-25-2008, 07:05 AM   #5
PHOLAN
Member
 
Join Date: May 2008
Posts: 48
Thanks: 0
Thanked 0 times in 0 posts
Default

Ray,

I'm executing the logic on the primary bars (3min) and placing the trades on the secondary ones (1min). The graph, a 3 min bar, still shows the SetStopLoss on the 3 min bar incorrectly. The position enters a short on the 3 min bar and it closes at a stop loss on the same bar, when in fact, the High of the bar was prior to the order being placed.

P
PHOLAN is offline  
Reply With Quote
Old 09-25-2008, 08:15 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Not sure what you mean. Please see executions tab to see what your orders are doing. Also, it helps tremendously to open a second chart of your 1min and match up the time frames to see the additional granularity.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-25-2008, 08:20 AM   #7
PHOLAN
Member
 
Join Date: May 2008
Posts: 48
Thanks: 0
Thanked 0 times in 0 posts
Default

The problem occurs when you look at historical trades on the 3 min bars when placing the trades in a secondary 1 min bars.
Basically, if I look at the trade in a 1 min chart, its a winning trade but, it shows as a stop loss in the 3 min chart. Even though I'm placing the trades in the 1 min chart.
It seems that the SetStopLoss is being executed on the 3 min chart instead of the 1min one.
PHOLAN is offline  
Reply With Quote
Old 09-25-2008, 08:25 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You need to look at the executions tab to see what or use TraceOrders = true to see what your orders are really doing. If you find this to be the case from the executions tab then your only option would be to not use SetStopLoss() and opt for an ExitLongStop() order.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

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
Chart Pixel Resolution designer Miscellaneous Support 1 09-21-2008 05:46 PM
Replay backtest resolution daven Strategy Development 3 09-17-2008 04:44 PM
charting vs backtest - bar resolution vs ticks tb2000 Strategy Development 8 07-02-2008 10:10 PM
Request for Integration of different instrument/datafeed/resolution into 1 chart spac qitrader Suggestions And Feedback 3 06-08-2008 10:52 PM
Second resolution support for DTN? Bormir Connecting 3 12-10-2007 07:40 AM


All times are GMT -6. The time now is 04:51 PM.