Tuesday, 4 March 2025

Very.... slow... mean reversion .... and some thoughts on trading at different speeds

 Bit of a mixed bag post today. The golden thread connecting them is the idea that markets trend and mean revert at different frequencies.

- A review of the discussion around timeframes for momentum and mean reversion in 'Advanced Futures Trading Strategies', in light of this excellent recent paper (which I also discussed on the TTU podcast, here from 1:02:12 onwards).

- A mea culpa on the mean reversion strategies in 'Advanced Futures Trading Strategies'. TLDR - there is an error in the backtest and they don't work at least in the specified form.

- A new slow.... absolute mean reversion strategy inspired by a question from Paul Calluzzo on the aforementioned podcast episode.

Note: in this article I use the terms momentum and trend following interchangeably to both mean absolute momentum - not relative.


When do markets trend and mean revert?

When do markets trend? When do they not trend... perhaps even mean reverting? This is a very important question! 

You might think it would depend on the market, but actually there seem to be some fairly common patterns across many different instruments. Here is how I summarised by thoughts in my most recent book, Advanced Futures Trading Strategies (AFTS):

Multi-year horizons: Mean reversion sort of works (although the results are not statistically significant, as the value strategy in part three attests). Note: this value strategy is a relative value strategy that looks for mean reversion within asset classes. Such strategies are common in academic equity research.

Several months to one year horizon: Trend following works, but is not at it’s best (consider the slightly poorer results we get for EWMAC64 versus faster trend variations).

Several weeks to several month horizon: Trend works extremely well (consider the excellent performance of EWMAC8, EWMAC16 and EWMAC32).

Several days to one week: Trend is starting to work less well (EWMAC4 and especially EWMAC2 perform somewhat worse than slower variations, even before costs are deducted).

A few days: We might expect mean reversion to work?

Less than a day: We might expect trend to work?

Less than a second: Mean reversion works well (high frequency trading - HFT - is very profitable).      

Note that 'momentum works for months or years' and 'mean reversion / value works for years' is a very well known stylised fact which has been established in the literature for many decades; see for example this seminal paper. And given the existence of profitable CTAs with holding periods in the weekly to monthly range, it's hardly surprising that momentum works for shorter holding periods. Nor is the fact that HFT firms make a ton of money a secret.

However, in the region between high frequency trading and a horizon of a week or so I wasn't sure exactly what to expect, but I speculated that there would be a region where mean reversion would start to work (more on that later!), and I also thought trend following with holding periods in the 'few hours' range (mainly because there has been some sell side research on that). Note that since my own data is hourly at best, I couldn't really test anything with a horizon of less than about one day.

Fortunately someone came along to fill in this gap in our understanding, with this excellent paper:

"Trends and Reversion in Financial Markets on Time Scales from Minutes to Decades" by Sara A. Safari and Christof Schmidhuber

I won't summarise the paper in much detail (for example it has some interesting results around the relationship between trend strength and reversal), but they have the following pattern of results (from figure 10 in the paper):


Horizon over two years: Mean reversion works, becoming more effective at longer horizons. They used literally centuries of data to check this result. 

One week to two year horizon: Trend following works, but it's effectiveness peaks at around one year

One hour to one week horizon: Trend following works, getting gradually less effective as the time horizon shortens.

Two minute to 30 minute horizon: Mean reversion works, and is most effective at the 4-8 minute horizon


The key differences between my results and theirs only occur in my 'zone of speculation', where I was only guessing and they had actual evidence so let's go with them :-) In particular they have two 'crossing points' from when mean reversion stops working and momentum starts working (at just over two years, and somewhere between 30 minutes and one hour), giving the following broad ranges:

Horizon over two years: Mean reversion works.

One hour to two year horizon: Trend following works.

Two minute to 30 minute horizon: Mean reversion works

Whilst I had speculated that there was something more complicated going on. Even without evidence, Occams razor would suggest you should prefer their results to mine.

Another difference is that when I looked 'optimal points' for eg momentum I was concerned with Sharpe Ratio, but they are instead fitting a response function and seeing when it has the best statistical fitness. Because of the Law Of Active Management, Sharpe Ratio (loosely) scales inversely with the square root of time for a given level of prediction accuracy. So you if you are equally good at predicting one year trends, and 3 month trends, the latter will have twice the Sharpe Ratio of the former. Hence there are good reasons why my optimal SR point is different from their optimal response point; all other things being equal the optimal SR is going to be at a shorter horizon.

Combining the two pieces of research together, and thinking about what sorts of strategies we could be trading, we get this:

Horizon over two years: Mean reversion works. The optimal SR is probably quite flat for anything between three and ten years. Equity value, relative value within asset classes, and absolute mean reversion (of which more in a moment) are all nice strategies. But given their holding period you shouldn't expect high Sharpe Ratios unless you are Warren Buffett (hi Warren!). 

One to two years: Momentum will work but will be getting steadily worse as the timescale gets longer, both from a predictability perspective and a Sharpe Ratio viewpoint. Avoid.

Three months to one year horizon: Trend following works with high predictability, but is not at it’s highest Sharpe ratio due to the slow turnover. However, the advantage here is that this is a playing field that even retail punters with expensive trading costs can play in. Slower momentum strategies are all good.

Three weeks to three months horizon: Trend following probably has it's optimal Sharpe Ratio somewhere in this region, depending on the asset class. Any medium speed momentum strategies are good, and nearly all futures traders can play in this area if they avoid a few very expensive instruments.

Several days to three weeks: Trend is starting to work less well (because the improvement from trading faster is being overwhelmed by the deficit in response) and trading costs will start to bite except for the very cheapest futures (see calculation below), traded with exemplary execution. On the upside, trend following models at this speed will have the highest positive skew. Trade selectively.

A few hours to several days: Trend still just about works but but there are probably only a small number of futures where  you can overcome the bid/offer costs (although I hear costs are very low in Crypto, and there might be US traders who get zero commission able to trade highly liquid ETFs like SPY); I'd doubt though it would be worth doing. As the authors note, strong trends also tend to reverse strongly in this region (see AFTS for my own confirmation of this effect). Against that there have been the sell side papers on this subject, but they seem to rely on gamma hedging effects which may not persist. Avoid.

1 hour to a few hours: The authors in the paper note that the very weak trend effect here can't overcome the tick size effect. Avoid.

Two minute to 30 minute horizon: Mean reversion works, and is most effective at the 4-8 minute horizon from a predictive perspective; although from a Sharpe Ratio angle it's likely the benefits of speeding up to a two minute trade window would overcome the slight loss in predictability. There is no possibility that you would be able to overcome trading costs unless you were passively filled, with all that implies (see below). Automating trading strategies at this latency - as you would inevitably want to do - requires some careful handling (although I guess consistently profitable manual scalpers do exist that aren't just roleplaying instagram content creators, I've never met one). Fast mean reversion is also of course a negatively skewed strategy so you will need deep pockets to cope with sharp drawdowns. Trade mean reversion but proceed with great care.

Less than a second to two minutes: Not covered in the paper, but I would speculate that mean reversion continues to work, and the pre-cost Sharpe Ratio would also continue to improve as the horizon falls. Proceed with even more care.

Less than a second: High frequency trading works, and clearly has a very high Sharpe Ratio, but this is not for the amateur.


Notes on costs: 

The very cheapest equity index future I trade has a cost of around 0.2bp assuming we execute market orders; and vol of around 20% a year, for a SR cost of  about 1bp. Median single instrument SR on the optimal trend strategy (holding period around 3 weeks) is around 0.30. Predictability, as a regression coefficient, from the linked paper is around 6.5% at 3 weeks; and around 1.8% at 2 days (a reduction of 3.6x). Time scaling would improve the SR by 2.7x so the net effect is a 25% fall in SR to around 0.22 for a two day forecast horizon. 

If we take a third of that (my 'speed limit') or 0.22 SR for costs, then our annual cost budget is 0.07 SR or 700bp; implying we could perhaps safely trade a couple of times a day implying a two day forecast horizon (which means trading once a day) is possible. 

But the median future I get data for has a cost of around twenty times that, meaning a holding period of around two weeks is required to meet the 'speed limit'.

Do we have to pay the spread? Broadly speaking, if you are trading slowly, then you can afford to be more patient in your execution, using passive fills where possible (as I do myself). But as a fast trend follower who thinks the price is going to move away from you in the near future, it's probably harder to sit on your hands and wait. 

Alternatively if we are fast mean reverting traders then we can use passive fills by setting limits around where we think the equilibrium is. That of course runs the risk of adverse selection, but without doing this we are never going to make enough money to overcome the bid/offer if we're trading dozens of times a day. You may also be still liable to commissions unless you received exchange rebates from providing liquidity. Note since we earn the bid/offer spread from passive fills, it might be that the best instruments for this strategy are those with wider rather than narrower bid/offers.



Forgive my father, for I have sinned against the gods of backtesting...

Now in AFTS I introduce two strategies which trade mean reversion, with horizons of around a week (since I'd speculated that would work). It included a very elegant way of including limit orders to passively execute, and the second strategy introduced a very nice trend following overlay. And it looked great! But that obviously isn't consistent with the findings above.

Well gentle reader, I screwed up. As I said in my book:

"But what jumps out from this table is the Sharpe ratio. It is impressively large, and the first we have seen in this book that is over two. In my career as a quantitative trader I have always had a long standing policy: I do not trust a back tested Sharpe ratio over two. There are certainly plenty of reasons not to trust this one. 

Firstly, the historical back test period, just over ten years, is shorter than I would like. There are good reasons to suppose that the last ten years included unusual market conditions that might just have favored this strategy. Secondly, it is hard to back test a strategy deploying limit orders that effectively trades continuously using hourly data. There may well be assumptions or errors in my code that make the results look better than they really would have been."

The underlined section (not underlined in the book!) is key here; basically there was an implicit forward fill in my backtest as I calculated the equilibrium price including todays closing price (which of course I wouldn't have known in the morning). The real backtest shows basically no statistically significant return at all.

The good news is that the basic technology of this strategy should work well, at least pre-costs, with a much shorter time horizon; although for all the reasons above I haven't tried it myself (though I know others that have).




A new slow absolute mean reversion strategy

Since I'm taking away one strategy, let me replace it with another. In AFTS strategy twenty two is a 'value' strategy, which bets on mean reversion over five year periods in relative terms against an asset class index. It has crappy SR (basically zero), but positive alpha and improved overall SR when added to trend and carry strategies. 

But on a recent TTU podcast, herePaul Calluzzo asked me if I'd ever tested absolute mean reversion. Certainly I haven't on this blog. So let's do that.

I'll use a three year return for my forecast, which is slow enough to avoid the two year point where we know momentum probably still works; whilst being quick enough to avoid the death by sqrt(T) that will reduce my SR. We go long if the return is negative so:

Forecast = Price_t-3yrs - Price_t

To avoid the turnover being excessive (this is a slow forecast!), and because we should always vol scale:

Smoothed vol scaled Forecast = EWM_64(Forecast/ EW_std_dev(returns))

Drumroll...

It's not..... great (SR -0.48), apart from perhaps a recent pickup. You could argue that as a lot of my data starts in 2013, and the first five year return occurs in 2018, that it's actually profitable for many instruments and we've just been unlucky in the instruments we've traded before. The median SR is -0.06 though which doesn't completely support that argument. 

But really it would appear that at least with this construction absolute mean reversion isn't as good as the relative mean reversion I tested in AFTS.

OK so we've dropped a strategy with an unfeasibly high backtested SR, and I've replaced it with one that has a very poor backtested SR. Unfair? Well, life isn't fair.


Summary

Good things to trade:

Horizon over two years:  Cross sectional mean reversion, but possibly not absolute mean reversion. And similar type things like equity relative value.

One to two years: Nothing*

Three months to one year horizon: Trend following of pretty much anything

Three weeks to three months horizon: Trend following; avoiding very expensive instruments.

Several days to three weeks: Trend following; only the very cheapest instruments.

One hour to several days: Nothing*

Less than a 30 minute horizon: Mean reversion - the faster the better, but only with limit orders and with great care (the faster you are, the more care needs to be taken).

* or at least not outright momentum or mean reversion

No comments:

Post a Comment

Comments are moderated. So there will be a delay before they are published. Don't bother with spam, it wastes your time and mine.