PDA

View Full Version : Backtesting parameters



AMR
25-03-2009, 12:25 AM
A really vague question, but what is a good assumption to use for slippage? I am backtesting mainly ASX200 stocks.

Lawso
25-03-2009, 08:26 AM
Backtesting parameters
------------------------------------------------------------------------
A really vague question, but what is a good assumption to use for slippage? I am backtesting mainly ASX200 stocks.
__________________
Disclaimer: Do not take my posts seriously. They are merely alcohol-induced rantings.

Especially at 11.25pm, eh, AMR?
I'd take this post more seriously if I knew WTF you are talking about.

Phaedrus
25-03-2009, 10:04 AM
When back-testing, I assume that the entry or exit is made at the Close on the day of the signal. For those that do not have access to the market during the day this is not a practical option, so they could use the Open on the day after the signal. As you would perhaps expect, the results are generally not quite as good.

So long as you are incorporating brokerage costs, I see no need to factor in "slippage" as well. If you really wanted to, you could build in some arbitrary percentage "slippage", but I don't see the point - after all, there is no reason why you shouldn't be able to buy/sell at the Close, or very close to it.

What software are you using?

AMR
25-03-2009, 09:42 PM
Thanks for the answer, I am using Ninjatrader with yahoo data. My entries are generally the day after the indicator signals on the open and unfortunately my results aren't as good as buying on the close as you mentioned, so hence the apparent need for slippage to account for gaps, market spread, etc.

Lawso, backtesting is running a strategy against old data to see how it performs. Slippage is the amount the price moves between the time you type your order in and the time it gets filled. Much better for the heart and mind too if you know how your strategy worked over the past 10 years.

AMR
25-03-2009, 10:21 PM
Bugger me...I found the holy grail tonight.:D

outspoken
26-03-2009, 07:28 AM
Bugger me...I found the holy grail tonight.:D

Hi AMR, is this referring to a strategy that you've developed and tested yourself?

AMR
26-03-2009, 08:32 PM
I've probably done something wrong there to be honest :) I told the system to buy the XJO contract on every oversold period (determined by 7 day stochastic crossing below and then back above 20) as long as the ADX was above 25 and the 200 day EMA. Sell strategy was when the 14 day EMA fell below the 200 day EMA. Unfortunately yahoo only has data from 2001, which was near the end of a bear market. I found it quite hilarious to get 100,000% profit from a "buy on the dips" strategy.

Now for a serious question - Does anyone have recommendations for a systems development book?

Xerof
26-03-2009, 09:33 PM
Strongly suggest you also now forward test it for at least 12 months......

AMR
27-03-2009, 11:50 PM
Strongly suggest you also now forward test it for at least 12 months......

Well testing it on out of sample data was a good suggestion. I tested it on the HSI and the SP500, and unfortunately it got cut to shreds. Ah well, time for trend following system, number 2.

AMR
29-03-2009, 03:25 PM
Another really vague question here...

For a system that trades end-of-day prices, how many trades are required for a statstically significant edge? I am testing from 1991 to 2009. My SP500 system only has 5 trades to it.

Phaedrus
31-03-2009, 09:24 AM
More data points would be better. The easiest way to achieve this would be by running your test over a longer time period.

Some general comments :-

Don't forget to compare your results with simply "Buying and Holding" over the same period. Overall, the market has a very strong Bullish bias and any system can look good. If you can't beat "Buying and holding", there is no point in trading.

You should also compare your results with those derived from a simple moving average crossover system. Backtest to find the optimum SMA period and see if your system beats it. If it doesn't, it's no good.

Be aware that indices are not stocks and do not behave in exactly the same way. Your results will be directly usable only if you want to trade the Spyder (SPY). They will not be directly transferable to stocks. Many studies have applied technical indicators to indices, found that they did not perform well and concluded that TA "doesn't work". The same indicators can work superbly when applied to individual stocks.