NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 01-28-2009, 01:35 PM   #1
cunparis
Senior Member
 
Join Date: Feb 2008
Location: Paris
Posts: 710
Thanks: 10
Thanked 10 times in 7 posts
Default When backtesting does entering on a shorter timeframe make a difference?

I test my strategy with and without using a lower timeframe and I get exactly the same results. I'm using 1 minute for my lower timeframe. I'm wondering if it makes any difference with backtesting. I can't figure out why I get the same results.

When I look at the trades, for example using 30 min for main timeframe and 1 minute for entries, I see that entering on 1 minute bar gives a trade at 9:32 and when I use a regular entry on the 30 minute bar it enters at 10:00. However, the prices are almost the same. Very close.

My guess is that if I program the entry to use the 30 minute bar, it's entering at the open of the next 30 minute bar which gives almost the same result as entering on the 1 minute bar. Is this the case for both backtesting and trading live?
cunparis is offline  
Reply With Quote
Old 01-28-2009, 01:41 PM   #2
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

The difference is in the granularity. If you see value in it then by all means use the additional granularity, otherwise it is your call.

Backtesting always has CalculateOnBarClose = true. You submit signal on 9:30 bar, trade occurs at open of 10:00 bar. In real-time you have the option to run CalculateOnBarClose = false which allows you to trade intrabar.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-28-2009, 01:49 PM   #3
cunparis
Senior Member
 
Join Date: Feb 2008
Location: Paris
Posts: 710
Thanks: 10
Thanked 10 times in 7 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
The difference is in the granularity. If you see value in it then by all means use the additional granularity, otherwise it is your call.

Backtesting always has CalculateOnBarClose = true. You submit signal on 9:30 bar, trade occurs at open of 10:00 bar. In real-time you have the option to run CalculateOnBarClose = false which allows you to trade intrabar.
Hi Josh thanks for the quick reply. Just to clarify, assuming I keep CalculateOnBarClose = false, is there a difference between backtesting & real time if I run a 30 minute bar and enter on a 1 minute bar?
cunparis is offline  
Reply With Quote
Old 01-28-2009, 01:54 PM   #4
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

Huge difference. Backtesting is always CalculateOnBarClose = true no matter what you try to set it to. Real-time with CalculateOnBarClose = false will process every single tick.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-29-2009, 12:45 AM   #5
cunparis
Senior Member
 
Join Date: Feb 2008
Location: Paris
Posts: 710
Thanks: 10
Thanked 10 times in 7 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Huge difference. Backtesting is always CalculateOnBarClose = true no matter what you try to set it to. Real-time with CalculateOnBarClose = false will process every single tick.
I'm sorry I miswrote what I meant.. I meant that if I use CalculateOnBarClose=true, what is the difference between backtest & realtime for entering on a 1 minute bar.
cunparis is offline  
Reply With Quote
Old 01-29-2009, 07:17 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

There are many differences. Please review this article: http://www.ninjatrader-support.com/H...sBacktest.html
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
Putting larger timeframe indicator over a shorter timeframe chart brownsfan019 Charting 1 06-25-2008 03:52 PM
Tip: How to make NinjaTrader’s ROC indicator to calculate the difference in points? KamaCoder Eric Indicator Development 0 05-17-2008 09:03 AM
Can the "My Documents" location make a difference? TheCD Indicator Development 4 11-20-2007 08:19 AM
Backtesting Multi-Timeframe does not match real market data. MONTERO Strategy Analyzer 17 10-01-2007 06:48 PM
backtesting a multi-timeframe strategy ceesvh Strategy Analyzer 1 09-18-2007 12:05 PM


All times are GMT -6. The time now is 03:10 AM.