Gold: Momentum or Mean Reversion?

GLD 2004-2015

Is gold a good momentum play or is it a mean reversion play?

Stupid question, right? Gold is a commodity, and commodities trend like there’s no tomorrow. Or like tomorrow is just like today. Right?

Maybe not, as it turns out.

I wanted to know if gold was in fact full of momentum-y goodness like everyone says. So I set up a test to see.

I chose the SPDR Gold Trust ETF (GLD) as my stand-in for gold prices. The ETF has been around since late 2004, and has seen a significant rise with a much more recent fall over its existence.

I then screened for all instances where the close moved more than one standard deviation (calculated over the previous 20 close-to-close returns) from the previous day’s close. I then looked at the returns for one day, two days, five days and ten days, to see if the move exhibited momentum or mean reversion. It didn’t matter the direction of the move – I included both short and long. I just wanted to see if the prices kept going in the same direction or not. Here’s what I got:

 

GLD trending results

Under 50% means a tendency toward mean reversion, and over 50% a tendency toward momentum. As you can see, GLD tends to be mean-reverting the day after a >1-standard-deviation move. But after that, it tends to continue in the same direction of the move (momentum). You can see that in the first row of data above.

Since GLD has been under two significantly different regimes, I wondered if there was a difference in the momentum/mean-reversion ratio when looking at long-only vs short-only moves.

First note the average gain/loss % for each holding period. Whether the trend was toward momentum or mean reversion, all holding periods show a positive expectancy with momentum.

But the short side shows a significantly greater tendency toward momentum, whereas the long side shows a tendency toward mean reversion in days one and two, and is ambivalent about the longer time periods. This is true even though GLD has had many more years of growth than it has had decline.

Of course I then had to check to see if there were any differences over the years! And yes, there are.

 

GLD trending by year
Note that 2015 is only through July 24th.

Again, any bar over 50% means a tendency toward momentum after the signal day, whereas under 50% mean a tendency toward mean reversion.

The results for a holding period of one day are all over the map. But the longer holding periods have shown a distinct bias toward momentum in the past, and yet lean toward mean reversion in the past few years. Ignoring that odd spike in the 2-day holding period for 2015, all the bars show a tendency toward mean reversion lately.

As for that spike: no idea why it’s the highest of all the years measured. Could simply be noise and the fact that the sample size is only half a year.

You might not like my definition of momentum, and that’s fine. I’m paying no attention to longer term trends in the prices here, but only using a one day change as a ‘breakout’. Ten days is the maximum holding period, so this is not a long term test. That’s the thing about momentum and mean reversion: one can become the other when the time scale is changed.

Conclusions? Other than that if gold spikes upward you should short on close and sell the next day at close? Wait, no, I’m not recommending that! But that’s not an unreasonable idea for a system based on the data. And then you could turn around and go long and hold for one more day.

Standard disclaimer: You should never trade anything but baseball cards. Trading commodities will give you hives and/or herpes.

The “Hitail” Swing Trade System: Revised

Recently I posted a swing trade system I call “Hitail” (read about here). It had initially used in-sample and out-of-sample data that was subject to survivorship bias. I’ve since made some minor tweaks to the system (most notably an anti-gap filter), and then a final run on survivor-bias-free data for the out-of-sample period. If you had looked at it before, take another look. The system still performs decently but with a caveat.

hitail revised w delisted OOS - equity

The FAS Double Down System – Results So Far

Screen Shot 2015-07-21 at 7.53.20 AMThat’s a weirdly straight equity curve, isn’t it? I spent a few minutes trying to figure out how I’d screwed up the graph parameters, but no, it’s accurate.

Back in April I described a swing trade system designed specifically for the 3x leveraged financial ETF known as FAS. On paper at least, it’s had a great hit rate and return since just after its inception. I say “just after” because the ETF was created just before the 2008 financial meltdown, and the first few trades were, shall we say, disheartening. (Although it should be pointed out that even during those hard times, there were winning trades as well as the other kind.)

“Yes ok you’ve created a great system in your imagination you numbwit, but how does it fare in the real world?” You ask an excellent question (if a little rudely). So I’ve tracked the system since then, and even traded it twice.

Since I published that post in April, there have been five trade setups. On a trade of $1500 rounded down to an even number of shares, with $4.95 commissions each way, you get the results below:

Click to enlarge.
Click to enlarge.

Which explains the freakily-straight equity chart. All but the first one are just around 3% profit.

If you like your equity curves showing all the hills and valleys in between (and perhaps prefer a dark background, which is much more of a  financial-tough-guy look), here ya go:

FAS dbl down update april to july 2015

Pretty good, eh? It’s such a ridiculously simple system. And yes, one day in the future the system will mightily implode, but all systems do. Until then, I’ll keep trading it occasionally.

P.S. This system seems to work with a few other 3x leveraged ETFs as well. I’ve modified the exit a little, but the basic any-moron-can-see-it entry signal remains the same. If you’re the backtesting type, give it a try on these tickers too:

BIB

CURE

RETL

UPRO

 

Filtering With Median Rather Than Average

Screen Shot 2015-07-16 at 11.48.11 AM

Yes I realize that might be the dullest blog post title I’ve ever come up with. Perhaps only to be topped by the dullest content ever…let’s see.

It’s quite typical when creating backtests to filter using some minimum measurement of trading volume. This ensures that you’re working with stocks that are liquid. Stocks that don’t have heavy trade volumes tend not to behave like your backtest software thinks they do. For very illiquid stocks, you may have to wait a long time to get your order filled, and market or stop orders may be subject to punitive bid/ask spreads. So when testing, you want to make sure your test eliminates these sketchy ne’er-do-well stocks.

Until recently I’ve been using a simple average (mean) of the volume. For example, I might require a stock to have an average 10-day volume greater than 100,000 shares. However I recently noticed some weird outliers skewing my results.

Averages are very sensitive to ‘tail events’. If you have nine small numbers and one big number, the big number is going to skew the average in its direction in a way that you might not have intended.

For example, see the lead image above? There’s a spike of 21.8 million shares in one day’s volume, but you can see that it’s not very typical of the stock. The 20-day average of volume is right around 1.5 million shares. However on most days the volume is well below that number.

So instead I’ve started using the median value of a series instead. I’ll use an odd number for the sample size so that I get a true median or ‘middle’ number. This gives me a value that doesn’t heavily weigh outliers, and seems more typical.

The median volume for the stock you see above is actually around 209,000 shares, which makes a whole lot more sense. If I’d been filtering out stocks under an average of 1 million shares in volume, this stock would have made it through. But when using the median value, it would have been dropped (and rightly so).

Don’t be mean. Be median.