Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 09-23-2009, 01:11 AM   #1

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,578
Ignore this user

Thanks: 2,022
Thanked 1,400 Times in 860 Posts



Backtesting Question

Quote:
I have a question on backtesting. The strategy I currently want to test exits upon hitting a profit target. In addition, as is often the case, there is a stop loss exit.

My question is how do you go about doing a backtest of something like that? The problem I have is that if I use daily bars, I could easily have a situation where both the PT and the SL are hit, within the same bar. How do I figure out which one gets hit first?

The only solution I can think of is to use shorter bars, like hourly.

I assume that is the standard way to proceed, or is there some obvious alternative that I'm missing here?

Someone sent me the above question, I thought I should post the answer here for the benefit of all.


MultiCharts has a feature called "Bar-Magnifier".
TradeStation calls it Look-Inside-Bar-Backtesting (LIBB).

MultiCharts/TradeStation lets you add a second data stream for backtesting.
For example if your strategy is to work on a daily chart. You can add a finer resolution 2nd data stream (eg 5min) to the backtesting, thus allowing the program to calculate your strategy rules and fill orders at intrabar prices, as if in real life trading.


Attached Thumbnails
Backtesting Question-backtesting_precision.gif  
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...

Last edited by Tams; 09-23-2009 at 01:34 AM.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
diablo272 (09-23-2009)
Old 09-23-2009, 01:23 AM   #2

Join Date: Nov 2008
Location: United States
Posts: 356
Ignore this user

Thanks: 122
Thanked 89 Times in 72 Posts



Re: Backtesting Question

TS backtesting functionality is better that Ninja backtesting apparently.
diablo272 is offline  
Reply With Quote
Old 09-23-2009, 01:26 AM   #3

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,578
Ignore this user

Thanks: 2,022
Thanked 1,400 Times in 860 Posts



Re: Backtesting Question

Some programs would use an algorithm to mimic intra-bar price fluctuation, you can get intra-bar order fill, but the price is simulated.
(ie. somewhere in between the high of the bar and the low of the bar.)
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...
Tams is offline  
Reply With Quote
Old 09-23-2009, 01:29 AM   #4

Join Date: Nov 2008
Location: United States
Posts: 356
Ignore this user

Thanks: 122
Thanked 89 Times in 72 Posts



Re: Backtesting Question

To be honest, I'm not 100% sure of the intricacies of Ninja backtesting (because I don't use it anymore), but from what I remember, it will give you a fill at the close of each bar, regardless of the timeframe, and there were no settings to adjust this. I could very well be wrong about that, but I'm quite sure that there is some aspect of Ninja's backtesting that made it useless for me, or at least very cumbersome to use.
diablo272 is offline  
Reply With Quote

Reply

Tags
backtest

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backtesting Software Recommendation Soultrader Brokers and Data Feeds 12 03-19-2010 12:13 AM
Backtesting Strategy ephi144 Automated Trading 3 04-13-2009 11:42 PM
Backtesting only mnkc Brokers and Data Feeds 3 02-08-2007 01:45 AM
Backtesting software mfoco Brokers and Data Feeds 5 12-12-2006 06:05 PM
Backtesting lasherm1 Beginners Forum 3 09-22-2006 09:20 AM

All times are GMT -4. The time now is 03:27 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.