Special Update 31 October
(At Bottom of Page)
I’ve been getting a lot of emails and comments about backtesting (thank you), and one of them set me back on my heels (thanks Michael! 😄). It was simply:
I’m not sure backtesting is “the” key. The market is not going to perform exactly the same one time to the next . . backtesting can be somewhat arbitrary.
Well, I thought ‘why DO I backtest and is it arbitrary? Have I been influenced too much by the quote often attributed to Mark Twain?
History doesn’t repeat itself, but it often rhymes.
The only information that we have is what has happened in the past, so we need to understand it and extrapolate. However, I read some articles critical of backtesting, and found that no-one was criticizing backtesting itself, but many were very critical of how it was implemented. So, I decided to check my backtesting strategies against the 5 main criticisms:
Data overfitting. This could come from a limited data set, so I have extended my backtesting to daily data going back 100 years. That’s 100,000+ data points (OHLCV) a decent sample size.
Survivorship bias. Operating on data from entities that survived and ignoring the ones that didn’t. If we use the market index, in this case the $&P 500, then we are not eliminating anything.
Changing market conditions. Yes, but ‘twas ever thus’.
Assumptions and simplifications. Agreed, too many backtests are guilty of this, hence my emphasis on objectivity. Let the data speak for itself.
Lack of emotional factors. There is a criticism that backtesting doesn’t account for the emotional and psychological aspects of trading. Yes, I totally get that, but I don’t think that emotion has any place in trading, which is why I only use a completely objective system, which does not depend on how I ‘feel’ about anything or what I ‘think’ it may do.
I couldn’t resist repeating the silliest quote about backtesting (Investopedia):
Be sure to paper trade a system that has been successfully backtested before going live to be sure the strategy still applies in practice.
Using Different SMAs
Many of the comments suggest we use a different SMA cross for getting in and out. For example, use the 10/200 to get in and the 5/50 to get out. That would get us out quicker in a downturn. It sounds nice and easy, doesn’t it? Well, it is – if you are going to make only one trade! Let’s say you have just seen a 5/50 death cross, and you are out of the market. The question is:
When do you get back in again?
On the 5/50 golden cross? In that case you are trading solely the 5/50 crosses, and on backtesting we find that it performs much worse, whipping us in and out of trades of which 62% are losing trades.
The next 10/200 golden cross? You may be waiting a long time and miss out on a bull market, Here’s what would have happened in 2020 – 2021.
The universe of possibilities
In probability theory, we have to consider all possible outcomes, so when we are considering the possible arrangements of our 4 SMAs there are 8 possible outcomes:
If we decide to choose a golden cross from the above, there are 6 possibilities:
Let’s say we choose the SMA5 / SMA50 Golden cross. That is found in arrangements 7 and 8 above, so we have to program for both these possibilities. Your eyes are probably glazing over about now. Mine certainly are. I have gone on long enough about backtesting, but your takeaway should be that entering and exiting on different SMA crosses is not as simple as it seems.
Working on 100 years of data for SPX (it was suggested by Sherman that I needed to extend my backtesting to include the 1987 crash – he was right, so I have, right back to before the 1929 crash), I compared the standard ITM method using the 10/200 cross, to the 10/50 cross. Here are the results:
While the % gains / losses are not markedly different, the average gain on most transactions for the 10/200 strategy is almost double. That, along with the number of trades, makes all the difference on your account balance.
Here I compare the results on 2 accounts, both starting with $100 in 1928. The black is 10/50, the red the 10/200 ITM.
You can see that using the 10/50 cross we didn’t even match the market, with the leveraged account doing even worse. (The leverage was 100% – a strike at 50% of current price and a time value of 1% lost on every transaction)
The 10/200 cross did extremely well – with the unleveraged account beating the market, and the leveraged account beating it amazingly. I would display the whole backtest, but it is 1,642 pages, so I will have to think how I can do that!
Where to now?
I am still testing lots of different strategies, no doubt there is a fantastic one waiting to be discovered. I’ll keep you updated.
To the markets:
It’s not good news – the SMAs are touching and if they crossover then we will have our OUT signal. That may happen on Monday, and if it does, I will send out an alert email.
You can see that we have dropped right through support and the next support level would be around $380 – which is only just above bear territory. Right now, we are officially in a correction phase, which is defined as a drop of 10%. Do all corrections end up as bear markets? No. But all bear markets start with a correction.
The SPYG chart is not quite so dire as SPY, mainly because of the relatively heavy weighting of technology stocks. While the 10 SMA has taken a downturn it is still some way from a death cross with the 200 SMA.
It has, however, dropped through support which is not a good sign. Since its high in July, it has dropped 7.6% so not quite in correction territory.
After 5 months in consolidation, QQQ has broken down and dropped through the bottom of the trading channel. Not good.
It has dropped 10.5% since its high in July, and so is also in correction territory. The next support level is around $320.
As you would expect, the VIX is elevated, and is now over 20 so we are no longer in a low-volatility market.
I thought it might be interesting to compare the performance of the 3 most-watched indices over the last 12 months: Here it is:
Interestingly, the DOW has been flat for most of the time, SPX climbed strongly in March – August, and QQQ very strongly between January and August. Since August, all three have been heading down. Dismal.
The week ahead . .
At time of writing (12 hours before market open) the futures are up . . could it be the turn around? I hope so. It is surprising how often the 10 and 200 touch but do not actually cross. ITM will stay in the market until we see a clear cross, which will be Monday if it is a big down day. I will send out an email if that happens.
But . . let’s not anticipate the worst – what’s that quote: sufficient unto the day is the evil thereof? No point making ourselves miserable until it actually happens!
Gadding about again . .
And next week – well, I am on holiday again. You may have heard of the Melbourne Cup, the ‘race that halts a nation’ – well race week is coming up, and I’m going over there, and going to do the whole big-hat-and-dress-up thing, just for fun. So, no blog next week – I just can’t bear trying to do the charts & photoshopping on a laptop, it is too fiddly, but I will be back again in a fortnight. I will still check the comments daily and answer any questions.
I’m not going to say fingers crossed for a good week – it doesn’t seem to be doing any good!!
I’ve had an email from Sheryl which I would like to share part of:
I’m a newbie , starting with SPYG. . . . . . I’m 87.
Fantastic Sheryl! You’re never too old to learn new things!
31st October Special Update
I have just sent out an email update to everyone, but in case you didn’t get it here is what it said:
31st October Update
SPY Death Cross
Monday’s trading, although it was an up day, was not enough to prevent a death cross. The SMAs have clearly crossed so that is our signal to get out of the market. If you are following the ITM strategy it is time to get back on the sidelines while the market decides what it is going to do.
SPYG has not yet had a death cross, so it has not had an OUT signal. Remember, it was backtested separately and does not always follow exactly the same pattern as SPY. QQQ, although we are not trading it, has not had a death cross either.
It has been a dismal two years. It’s bad news, I know – we were all looking forward to a nice bull market with lots of lovely profits, but the market just isn’t behaving. We’ll get back in when it does.
Questions & Comments
As always, happy to answer questions and receive comments (just be kind!)