Systematic Trading research and development, with a flavour of Trend Following
Au.Tra.Sy blog – Automated trading System header image 2

Volatility Filters

September 23rd, 2010 · 6 Comments · Backtest, Trend Following

filter-noortjeI have touched on trading regimes before; and looking at volatility-based regime switching was in my research stack since then. Today, I’m looking at a practical example: Trend Following results based on entry vs. past volatility.

System Code Concept

I developed a simple Trading Blox filter, which calculates the current volatility (via the Average True Range) and its percentile rank over the past data.

The filter defines a range of accepted volatility ranking values, for which a trade can be taken. This would allow for a system to reject all trades for which volatility is too high (eg. in the top decile) or too low, or a mix of both.

The filter code is available for download at the end of this article. The parameters I used were 39 days for the (exponential) ATR and a lookback of 250 days for the percentile ranking.

The actual system tested here is a classic 20/50 Moving Average cross-over used in the State of TF report, using the same diversified portfolio.

Volatility: Good or Bad?

Trend Following is often thought of as a “long volatility” strategy, but could high volatility prior to trade entry be detrimental?

In effect, Trend Following usually generates lots of small losers balanced out by small and medium winners, the positive performance coming from some large winners (from the fat-tails). That’s one way of looking at it – which can be illustrated with this distribution of R-multiples for the 20/50 MA cross-over system:

R-multiple

All winning trades from 0R to 7R can be seen as balancing out the losing trades (mostly between 0R and 1R), whereas the “big hitter” trades (8R+) make up the profitability of the system.

If using a classic fixed fractional money management based on volatility (for example R = trade entry risk = 3 ATR = 1% equity), the R-multiple is akin to a volatility multiple. And with relatively high entry volatility, it is less likely that the volatility multiple can reach high values, and therefore the system is less likely to generate “big hitting” trades.

This is what we’re going to check.

System Test Results

In order to test the impact of trade entry volatility levels on trade profitability, I ran the system in steps, with the volatility filter boundaries covering each distinct decile (ie. between 0 and 10%, 10% and 20%, etc.)

The results are below:

ATR Rank # Trades Win % Pct Profit factor R-multiple
0-10 1511 0.234 1.76 0.47
10-20 1615 0.272 1.82 0.52
20-30 1671 0.281 1.67 0.42
30-40 1676 0.262 1.55 0.36
40-50 1698 0.276 1.48 0.31
50-60 1663 0.283 1.53 0.34
60-70 1587 0.301 1.71 0.43
70-80 1583 0.312 1.47 0.3
80-90 1452 0.293 1.36 0.23
90-100 1295 0.275 1.18 0.12

 
There does seem to be a negative trend between trade average R-multiple and relative volatility value:

Trade-Stats

What is quite striking is that the Win % does not change much across all deciles (and if anything goes slightly up), unlike the average R-multiple. This seems to indicate that the winning trades simply fail to hit these high R-values when volatility is high at time of entry.

Below are the results when zooming in on the top decile:

ATR Rank # Trades Win % Pct Profit factor R-multiple
91-100 1254 0.257 1.11 0.07
92-100 1215 0.255 1.11 0.07
93-100 1169 0.243 1.02 0.01
94-100 1135 0.234 1.02 0.01
95-100 1068 0.23 0.98 -0.01
96-100 1021 0.231 0.98 -0.02
97-100 914 0.228 1 0
98-100 882 0.221 0.98 -0.01
99-100 814 0.211 1.06 0.05

 
Adding these high volatility trades might result in extra diversification (if one is to adopt the logic of “the more the merrier“) but they definitely do not seem to be the best use of your (probably precious) margin. If your available margin allows you to trade 50 instruments with no volatility filter, you might be able to trade 55 instruments at 90% max volatility instead, and get a better trade profitability.

In any case I ran a quick test by filtering the high volatility trades at 90%, 95% and 100% (no filtering) and the results show an improvement when filtering:

  • 90%: CAGR = 53.65%, MAR = 0.73
  • 95%: CAGR = 52.90%, MAR = 0.68
  • 100%: CAGR = 46.08%, MAR = 0.5

Code Download

The Trading Blox code is composed of 2 blox:

    • Auxiliary Blox, which calculates the percent rank for the ATR
    • Portfolio Filter Blox, which stops trades from being entered if they breach the acceptable percent rank range.

    These could be added to any standard system without modifications.

    Aux_ATRPctRank
    Port_ATRRankFilter

    Related Posts with Thumbnails

Tags: ·

6 Comments so far ↓

  • oliver insualnder

    Great Test,
    I have thought about doing a simular test but you beat me to it, thanks. Too bad you did not code it in AB though.
    Oliver

  • Pretorian

    Hi, I am pretty new to trend following although I have been following your blog for quite some time, congratulations, it is one of blogs around. Anyway since many of my strategies involve selling options, the long volatility profile of trend following began to interest me as a hedge, I want to know if I understand it right, I believe regimes with inital large volatility (for example 2008 beginning of 2009) make the bet much smaller since the 1% equity risk represents less notional since vol is so high so the big home runs are simple not there to make the system profitable. This seems quite important, because in 2009 the were really big trends (the reverse of the ones in 2008) however trend following performance was awful. Maybe it would be interesting to explore using a smaller ATR for stop loss instead when vol is really high.
    Pretorian

  • Pretorian

    I am sorry, I meant one of the Best trading blogs around.

  • Jez Liberty

    Thanks Pretorian.
    Correct: with higher volatility the 1% bet size would mean less notional and because high vol, less likelihood of big home runs indeed.
    That might well be a reason why 2009 was not very succesful for Trend Followers – although some Trend Following strategies made money.

  • nqwr

    Jez -

    Am I correct that this code needs to be manually primed ? The percent rank function you have created will only start calculating on the test start date, and won’t give a good result until “ATRPctRkDays” have passed.

    My approach has been to create a filter that does not allow trades to occur until after “ATRPctRkDays” have passed. However, this will have an effect on calculations that use the test start date, such as CAGR, etc.

    I have not found a way to get custom indicators in Trading Blox to prime before the test start date, curious if you have a better approach.

  • Jez Liberty

    nqwr, yes I think you’re right. In theory the code needs to be primed so that no trades are allowed before ATR priming + ATRPctRkDays. On other projects I had to actually check the day index for various pieces of code for custom indicators.
    In practice for this test, I am not sure how I did it but I think I must have added another (dummy) indicator which would have been primed just on ATR priming days + ATRPctRkDays.
    I’d check the TB forum for discussions on this topic…

Leave a Comment