cephalopod Profile picture
Nov 1, 2022 37 tweets 7 min read Read on X
Couple of thoughs about trend following is probably the most straightforward systematic trading strategy to implement - you're just buying the stuff that's been going up and selling the stuff that's been going down.
It's big business though - the CTA industry (which is largely trend followers) manages ~$350bn in funds and managed accounts, and there is probably half that again in in-house implementations, multi strategy funds etc.
I've implemented very simple and very complex trend following strategies, with assets ranging from a few tens of millions to a few billions, so thought it might be interesting to talk about how they work and how you would go about building one.
I'm not going to get into a discussion about whether markets trend, or what might cause trends. From my point of view it is obvious that trends exist and can be exploited systematically. This thread is about how to build a trend following strategy *assuming that trends exist*
The strategy has a few pretty well defined components -

1. Universe selection
2. Trend detection (aka signal)
3. Mapping from trend strength to desired position
4. Sector/asset class weights
5. Portfolio risk targeting
6. Trading rules
7. Execution
Universe selection. You want to trade as many *diversifying* markets as you can. The performance of trend following on a single market is pretty bad, around 0.2 Sharpe. But the strategy scales like sqrt(breadth), where breadth is the number of independent markets you trade.
For example, if you already trade S&P 500 and Nasdaq futures, then adding DJIA futures to the strategy will give almost no benefit. But adding something uncorrelated (e.g. natural gas futures) will help a lot.
Most trend followers trade futures, or other derivatives that allow them to use leverage. A typical futures trend follower might trade 60-80 futures markets on the major exchanges (CME, ICE, Eurex). A bigger and more sophisticated fund might trade 300-400 markets, including many
unusual or niche futures markets (e.g. power, cryptocurrencies, freight) as well as FX forwards or NDFs, interest rate swaps, or CDS indices. I don't think it's unrealistic to say you can increase the Sharpe ratio of the strategy by 1.5-2x by expanding the trading universe.
The trend signal is obviously important, but perhaps less than you think. It's normally quite obvious whether a market is trending up or down. The challenge is to capture this quantitatively. The most common trend signals are variations on moving average crossovers - for example,
a fast moving average of (log) price minus a slow moving average, probably normalized by volatility. These have the advantage of being simple and hard to overfit, whilst also filtering out the higher frequency return noise (they act like a low pass filter).
It's typical for trend followers to try and detect trends on horizons from 1 month to 1 year, with an average around 3-6 months. Some managers specialise in short-term trend following, even intraday, but they are generally much smaller. It's rare to focus on >1y trends.
Once you have the trend signal, it's common to pass it through another function which maps the signal to a target risk allocation for that market. Normally you don't want to continue building the position as the trend gets stronger - you want to cap out at some point.
Two common approaches are a sigmoid function (left) or a function like x * exp(-x^2) which reduces the target position for very large values of the trend signal (sometimes called "overextension")
Image
Image
Going to take a break but I'll continue with sector weights, portfolio risk targeting and trading/execution later.
Obviously I had a typo right in the first tweet, FML.
Picking this up. One thing you might do here is add a bias to this function for markets which are expected to go up on average (eg equities, credit or fixed income). This tends to improve Sharpe though I personally don’t like doing it because it weakens one of the nice
properties of the strategy — its ability to profit in fixed income or equity bear markets. However empirically it seems like a lot of trend following managers do this.
Once you have this mapping from trend strength to target exposure, the most common way to size positions is to make them inversely proportional to a market-specific volatility forecast. The idea is that for a given trend strength, each market contributes equally to risk,
to maximise diversification. Volatility forecasts can be as complicated as you like, but you get most of the benefit even with very simple forecasts, eg a blend of a steady-state long term volatility (estimated over 10 years) and a short-term realized volatility (eg 30-60 days)
Sector-specific weights are something you can do to try and get some extra juice out of diversification. For example, if you trade equity indices and fixed income, but have 2x the number of equity futures as you do rates futures, then equal weighting all markets leaves you
overweight equities. So you might increase the size of your your rates positions by a factor of 2 to balance this. Or maybe you trade both rates and commodities, with the same number of markets in each, but correlations between commodity markets are lower than between rates mkts.
Without any adjustment, commodities would contribute less to your portfolio risk than rates, so you might size up the commodity positions until each sector contributes equally to risk in the long run.
There are many approaches to this, from simple equal weighting to complex hierarchical or pca-based methods. My current favorite is to bucket up the universe into broad asset class groups, and try and have roughly equal volatility from each asset class in the long run.
Portfolio risk targeting is about controlling overall risk of the strategy. If you don’t do anything here you will run very little risk when not many markets are trending, and a lot of risk when there are many strong trends. The range can be like 0.3x to 3x your target risk.
If you’re happy to sometimes run a 60% vol portfolio when your target is 20% maybe that’s fine, but lots of people don’t like it (especially if you are running the strategy on behalf of a conservative LP, like a pension fund or investment consultant).
Something you can do here is size up positions a bit when there are few trends, and size them down when there are many trends, to try and stay closer to your target risk level. That sounds crazy but empirically it seems to improve sharpe ratios.
You end up with a more consistent PnL stream, at the cost of reducing your potential gains when trends are very strong (which empirically seems to happen in big equity or rates bear markets). The right answer here probably depends on why you are allocating to the strategy and
how it fits in with the rest of your portfolio (eg is it an alpha source alongside many other uncorrelated strategies, or are you hoping to use it as a partial hedge for long-only equity or fixed income positions you hold elsewhere).
Taking another pause here, more later.
We’re back.

Trading rule. You don’t want to trade on every change in your signal or vol forecast. You would just churn volume and cost yourself money in commissions/slippage. Better approach is to use buffering, as described in the post below.
This helps you stay pretty close to your ideal target positions, while reducing turnover and therefore reducing transaction costs. You can vary the size of the buffer with market conditions, eg making it wider when spreads are wide, and for low vol assets (where your
positions and trades will be larger, so impact of churn is higher). If you are running a large book (say $100m or more) you might also want to only trade partially toward the target, so that you get into positions over multiple days, but that’s not usually necessary for
a smaller book trading liquid markets.

The advanced version is to use a portfolio optimiser, though for a simple strategy like trend it’s not really necessary (and it creates more ways for things to go wrong, so may be better to skip it and use simpler heuristics instead)
Finally, execution. The big choices here are whether you do the execution in house or delegate to a broker, and whether you use an algo or get a human trader to work it. None of this is particularly different for trend following than any other slow strategy so I won’t get into
it much other than to say that algos (including broker algos) are fine for almost all liquid markets, but for something less liquid or more niche there are still situations where a human trader can add value.
I think that’s it. If you have particular questions put them under this tweet and I’ll try to answer as many as I can.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with cephalopod

cephalopod Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @macrocephalopod

Jan 30
Thursday morning quant interview question. A junior comes to you with a ML model trained using walk-forward validation, and shows the following backtest, created by stitching the out of sample periods. What are your comments? What might they have done wrong, if anything? Image
I think 4-5 people got this exactly right, and a few more had answers along the right lines but didn't mention some key detail. This is the first definitely correct answer that I saw -
This is the most succinct definitely correct answer -
Read 4 tweets
Jun 27, 2024
Correlation between your signal and future returns is an important metric in quant trading. But what is a “good” correlation? Here’s a simple way to think about it.
We’ll use a simple model where future returns y over some time period tau are normally distributed with a mean of beta * x and a daily volatility of sigma (here x is a signal with std deviation 1) Image
We can easily work out the correlation between signal and returns and use that to express beta as a function of correlation, volatility and forecast horizon. Image
Read 9 tweets
Jun 1, 2024
Interesting discussion, and follow the thread for further discussion of whether risk models cause crowding or not.

My view — they don’t really. Maybe a little on the margins, but the main drivers of crowding are alpha-driven rather than risk-driven.
In quant firms, proprietary signal research can uncover new, idiosyncratic alphas (which causes firms to decorrelate). But over time these ideas diffuse (researchers and PMs move between firms and take ideas with them) which causes them to correlate and crowd into the same names.
Use of the same “alternative” datasets also causes quant firms to converge, even more so now that many firms use data brokers to source new datasets (and the brokers will give little nudges like … “we’re seeing a lot of interest in this dataset, maybe you should take a look”)
Read 6 tweets
May 29, 2024
Does the profitability of vol selling strategies depend on starting volatility level?

A short story.
We start with front month VIX futures beginning in 2005, shortly after the contract was launched, so ~20 years of data.

For each day, calculate the P&L from shorting one futures contract. By working in price space we ignore any issues from from calculating VIX returns.
Every 21 days, sample the starting VIX level, and calculate the P&L from being short one near-term contract, assuming we roll over to the next contract at expiry.

This means that we have a dataset of non-overlapping sample P&Ls with ~1 month holding period.
Read 6 tweets
May 17, 2024
One more post about RenTech because it gives me an excuse to talk about Sharpe ratio, autocorrelation and scalability.

One thing that’s a bit surprising about RenTech returns is that their Sharpe ratio is “only” about 2.1 gross and 1.9 net.
With volatility of 30% on gross returns and 20% on net returns, that translates into 60% returns gross and 40% net.

These are great results by anyone’s standard, especially sustaining it for 30 years.
But top prop firms and multistrats have higher Sharpe ratios (eg 3ish for multistrats and much higher for top prop firms).

So what’s going on?
Read 11 tweets
May 16, 2024
Many mistakes here, including confusing gross and net returns, and not understanding the the fund mostly paid out profits as a dividend, so you couldn't compound.

So if you invested $10,000 into Medallion at the start of 1988, how would you *really* have done after 30 years?
It's pretty easy to figure out, since the net returns are listed along with the fund size at the end of year year, so we can approximately know how much capital was allowed to remain within the fund and how much was returned.
Assume that if the fund size grew by more than the net return, then all capital remains within the fund. Otherwise assume that the difference was returned as a dividend and invested into treasuries.
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(