trading

Mean-Reversion Volatility Filters Part Two: Since 2011

On my previous post, Mean-Reversion Volatility Filters, I used a dynamic volatility filter to filter out trades within  a short-term mean reversion system. I came to the conclusion that low vol was conducive for short term mean reversion performance. However, it’s commonly discussed how the market has shifted dynamics some time after the 2007-2008 financial crisis. In this post I revisit the tests ran in my previous post, testing from 1/1/2011 – 4/28/2013 rather than 1/1/1995 – 4/28/2013. The charts displayed below are 10-trade moving average of % profit from 1/1/1995-4/28/2013.

Results

IBS

Rules (Base-Case):

  • Buy if 3-Day IBS < 40
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.53%

IBS Base Case 10-Trade MA

Rules (High Vol):

  • Buy if 3-Day IBS < 40 AND HV(5) > HV(20)
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.68%

IBS High Vol 10-Trade MA

Rules (Low Vol):

  • Buy if 3-Day IBS < 40 and HV(5) < HV(20)
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.38%

IBS Low Vol 10-Trade MA

RSI

Rules (Base-Case):

  • Buy if 2-Day RSI< 50
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.21%

RSI Base Case 10-Trade MA

Rules(High Vol):

  • Buy if  2-Day RSI< 50 and HV(5) > HV(20)
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.40%

RSI High Vol 10-Trade MA

Rules(Low Vol):

  • Buy if  2-Day RSI< 50 and HV(5) < HV(20)
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.10%

RSI Low Vol 10-Trade MA

Conclusion

Without looking at the charts, it may seem like post 2011, this volatility filter, like many strategies, has completely changed. However after looking at the charts of a rolling 10-trade moving average of % profit. the results become more inconclusive. It seems much more likely that the short term test results are due to unrepresentative and small sample size, rather than a change in volatility filter performance.

 

Advertisements

Mean-Reversion Volatility Filters

Due to the result’s of this MarketSci post, which imply that short-term mean reversion performs better during low volatility versus high volatility, I decided to revisit volatility filters. In Mean-Reversion within Regimes, I previously concluded that high volatility, not low volatility was more conducive to mean-reversion strategies. To test for low volatility/high volatility I decided to use a different filter. Last time I used a static test (60-Day Historical Volatility > 0.01 = High Volatility, <0.01 = Low Volatility). This time I will use a more dynamic filter, which compares short-term volatility to mid-term volatility.

Results

  • Testing on SPY from 1/1/1995- 4/28/2013

IBS

Rules (Base-Case):

  • Buy if 3-Day IBS < 40
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.56%

Rules (High Vol):

  • Buy if 3-Day IBS < 40 AND HV(5) > HV(20) 
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.39%

Rules (Low Vol):

  • Buy if 3-Day IBS < 40 and HV(5) < HV(20)
  • Sell if 3-Day IBS > 40
  • Avg. Trade: 0.68%

RSI

Rules (Base-Case):

  • Buy if 2-Day RSI< 50
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.32%

Rules(High Vol):

  • Buy if  2-Day RSI< 50 and HV(5) < HV(20)
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.27%

Rules(Low Vol);

  • Buy if  2-Day RSI< 50 and HV(5) < HV(20)
  • Sell if 2-Day RSI > 50
  • Avg. Trade: 0.37%

Conclusion

It seems from this, in combination with my previous conclusion from Mean-Reversion within Regimes, that the specific filter used for volatility has a large influence on profitability. One thing I realized is that there may be different exposures for low vol vs high vol (meaning that a high volatility filter may allow for more trades, resulting in a higher CAGR) which could result in the discrepancy in results (that is why I used Avg. Trade rather than CAGR this time), but even after re-running the different tests under the same conditions, high vol had a higher Avg. Trade vs low vol.

A New Approach to Trading

Recently I changed the way I approach trading system development. Reading A Different Approach to Money Management is what gave me the original idea to alter my approach to trading, but my research is what pushed me over the edge.

Old Way

I approached trading system development with the goal of trying to develop a system with maximum exposure. I didn’t think of running two systems at the same time on the same pool of money (without splitting up the money) if the systems had little/no conflicting signals. Since most of the systems I tested on SPY either had either:

  • high exposure but low returns
  • high returns (after factoring for exposure) but low exposure

I was left with trying to develop a new system, or trying to trade the system over a large group of stocks (I used the Nasdaq-100 as my stock universe). While I was able to ramp up my exposure to around 70% with any system I tested, I often had to trade 5 or more stocks just to have a reasonable draw-down, which meant that commissions ate a large percent of my trading profits, considering my systems were short term in nature and I have limited capital.

Pros:

  • Only one system to manage
  • I don’t have to check for as many signals

Cons:

  • Not diversified – higher risk
  • High commissions due to being forced to trade many stocks to increase exposure
  • Can be curve fit easily since I try to develop one super-system
  • Higher model risk – there is only one model, which can fail at any given time

New Way

Now, I try to develop multiple systems that have high average profit% per trade with little/no regard for exposure. Even if the system trades only once every two or three months, I can combine many of these systems to trade at a frequency I would be trading at with my old way, but still maintain a highly profitable trading system with lower risk (assuming the systems do not have perfect correlation). While it’s too soon to draw any conclusions from live performance, the historical backtest shows dramatically improved results.

Pros

  • Higher returns
  • Lower risk
  • Lower commissions since I only have to trade one stock (I trade SPY)
  • Less risk of curve-fit – I will not be forced to include multiple filters to decrease risk/increase returns
  • Lower model risk – chances of multiple models of failing is lower than one model failing

Cons

  • Much more of a headache to manage when entering in trades EOD

Mean Reversion Trading in Moderation

Simple mean-reversion trading strategies in US equities have performed poorly since 2010/2011. Mean reversion is not dead, it never will be, but it may expressed differently than previously. Mean reversion prior to 2010, existed mainly in the form of extremes. The more extreme a pullback, the higher chance for a huge reversal. To test this, I ran 10 different frictionless  tests on SPY (from Yahoo! Finance) from 1/1/2000 – 1/1/2010.

Rules:

  • Buy if the 250-day DV2 is greater than a threshold AND if it is less than the threshold + 10 (this means I will only buy if the DV2 is within a certain 10 point range).
  • Sell the next day.
  •  It is worth noting here that I have an option on in AmiBroker that prevents me from entering buy orders the same day that I enter sell orders, which will lower the overall exposure of these systems.

Here are the results:

1-1-2000 - 1-1-2010 Moderate Mean Reversion

We can clearly see that the returns are largely derived from the 1-11 bucket, meaning that extreme mean reversion was the source of returns. In the past 3 years, mean reversion exists in more moderate forms. Extreme pullbacks no longer indicate large reversals, but moderate pullbacks are more indicative of future gains. To test this, I ran the same test from 1/1/2010 – 1/1/2013:

1-1-2010 - 1-1-2013 Moderate Mean Reversion

The returns for the past three years are from the 31-41, 41-51, and 51-61 bucket. The 1-11 bucket went from a 6% CAGR to a -2% CAGR.

Here are the rules for another test I ran. This should be the result of the above rules if I allowed entries to be entered the same day as exits.

Rules:

  • Buy if the 250-day DV2 is greater than a threshold AND if it is less than the threshold + 10 (this means I will only buy if the DV2 is within a certain 10 point range).
  • Sell if the 250-day DV2 is less than a threshold OR if it is more than the threshold + 10

Results for 1/1/2000 – 1/1/2010:

Full Exposure Moderate Mean Reversion 1-1-2000 - 1-1-2010

Results for the same test for 1/1/2010 – 1/1/2013:

Full Exposure Moderate Mean Reversion 1-1-2010 - 1-1-2013

This is only a preliminary test over SPY, but it does lead to avenues for further research.

Rotational Momentum Investing: Normalizing the Data

I’ve been looking into trading a rotational model using momentum lately. This post covers a few good reason for why one should trade momentum. My personal reasons are:

  • It provides diversification
    • I plan to trade a mean-reversion system soon, so adding a trend-following trading system will smooth my equity curve.
  • It is proven within academia
    • There are multitudes of research papers written over the momentum effect, and it is well-established anomaly within academia. You can find some of these for free over at QuantPedia.
  • Easy to trade
    • Trading a momentum system will only require to monitor it weekly, or monthly, leaving time for research into other efforts.

The momentum system being tested:

  • Invests 100% of equity in the top four stocks using equal weights.
  • The stock universe is all NASDAQ-100 stocks according to the NASDAQ website on 01/01/2013 (ticker list: NASDAQ Ticker List)
    • Not free from survivor-ship bias – results will be inflated
  • Test will be frictionless, from 01/01/1998 – 01/13/2013
  • Re-ranks and trades monthly. Does NOT re-balance monthly.
    • I used AmiBroker to test this. I re-rank at the first, second, and third day of every month. I also set an option where I am forced to hold onto a position for at least 5 days before selling. There are some occurrences where this may not perfectly replicate a monthly re-rank.

For this test, I will be using four different indicators:

  • TSI()
    • CAGR: 31.52%
    • MDD: -69.06%
  • Close relative to the 250-day high of the high
    • CAGR: 13.38%
    • MDD: -50.84%
  • 250-day ROC of Close
    • CAGR: 35.25%
    • MDD: -73.00%
  • Close relative to the all-time high of the high
    • CAGR: 15.17%
      MDD: -49.86%

For the purposes of creating a better performing ranking criterion, I will aggregated all four indicators into one. There are two obstacles I must first overcome:

  1. Normalizing the criterion
    1. The four indicators each have different scalings and different distributions. To create an aggregate indicator, we should normalize the indicators so they have similar sensitivies.
  2. Weighting the criterion
    1. The four indicators will most likely not contribute equal amounts to increasing performance. TSI() may have twice as much predictive power as the 250-day ROC, or it may be the other way around. Designing a weighting scheme will assign relative importance to the contribution of an indicator to ranking criterion

Normalizing the data:

There are two methods of normalizing the data which I will be testing for individual performance. The perfect rank function, and the z-score function.

Z-Score:

  • TSI()
    • CAGR: 18.48%
    • MDD: -68.04%
  • Close relative to the 250-day high of the high
    • CAGR: 17.33%
    • MDD: -49.88%
  • 250-day ROC of Close
    • CAGR: 25.55%
    • MDD: -46.69%
  • Close relative to the all-time high of the high
    • CAGR: 19.29%
    • MDD: -42.78%

Percent Rank:

  • TSI()
    • CAGR: 20.21%
    • MDD: -65.30%
  • Close relative to the 250-day high of the high
    • CAGR: 14.45%
    • MDD: -54.53%
  • 250-day ROC of Close
    • CAGR: 22.48%
    • MDD: – 45.45%
  • Close relative to the all-time high of the high
    • CAGR: 16.07%
    • MDD: -50.51%

Conclusion:

Z-score turned out to be better at normalizing indicator sensitivities while maintaining (or in the case of close relative to the all-time high of the high/250-day high of the high, increasing) performance.  From this test, we can also form a tentative conclusion that TSI and 250-day ROC are indicators that perform better as a ranking indicator on an absolute basis (it doesn’t matter historically where the indicator resided), whereas for indicators such as the close relative to a variable, they perform better on a relative basis (where the indicator has resided historically positively impacts performance).

4-Hour Body Principles in Trading

I was reading The 4-Hour Body by Tim Ferriss and found two quotes that are highly applicable to trading:

On psychology:

Does that mean [the workout routine] won’t work for some people? No, it just means that it will fail for most people. We want to avoid all methods with a high failure rate, even if you believe you are in the diligent minority. In the beginning everyone who starts a program believes they’re in this minority.

Take adherence seriously: will you actually stick with this change until you hit your goal?

If not, find another method, even it it’s less effective and less efficient.

On listening to others:

Everyone you meet (every male, at least) will have a strong opinion about how you should train and eat. for the next two to four weeks, cultivate selective ignorance and refuse to have bike-shed discussions with others. Friends, foes, colleagues, and well-intentioned folks of all stripes will offer distracting and counterproductive additions and alternatives.

Nod, thank them kindly, and step away to do what you’ve planned. Nothing more and nothing different.

RSI of Volatility Indicator

It’s common knowledge by now that low volatility is conducive to bullish behavior and high volatility is conducive to bearish behavior. To create a trading system that would short bursts of high volatility and buy short periods of low volatility I took the 5-day RSI of the daily Close-Open Range.

Edit: Commenter Ramiro called to my attention that I do not actually take the RSI of the Close-Open range, just the Close-Open. I’m actually measuring the magnitude AND the direction, meaning that this is just simply another mean-reversion indicator, NOT a volatility indicator.

To turn my indicator into a trading system, I optimized buy and sell threshold (1-100) on SPY from 1/1/2000 – 12/29/2012. I optimized a long-only version of the system. Here is a picture of the 3D optimization with CAGR on the z-axis.

RSI 5-Day Extreme Close Range Optimization Buy Thresh 1-1-2000 - 12-29-2012

Buy Threshold

RSI 5-Day Extreme Close Range Optimization Sell Thresh 1-1-2000 - 12-29-2012

Sell Threshold

There is a small hilly region near the middle. I chose 40 as my buy threshold and 55 as my sell threshold since they are round numbers within the hilly region.

One thing peculiar that I noticed, but can’t seem to explain is that there are two of every set of system statistics, and the only difference is 1) the parameters of buy/sell threshold are switched and 2) the number of trades:

RSI 5-Day Extreme Close Range Optimization Peculiar 1-1-2000 - 12-29-2012

After some pondering I noticed that it might be because some of the buying is negligible. For example, if we have a 40/60 threshold then we will buy if the RSI is at 30, regardless if the 40 or the 60 is the buy threshold. However, the problem that I came across is that if the RSI is at 30 today, but is at 50 tomorrow, then we will buy & hold for a 40/60 threshold (buy when RSI < 40 and sell when RSI > 60), but we will buy & sell for a 60/40 threshold ( buy when RSI < 60 and sell when RSI > 40). I can’t seem to figure out why there each set of system statistics has a twin.

Next, I optimized the short and cover threshold (1-100) on the same data, using a short-only version of the system. Here is a picture of the 3D optimization with CAGR on the z-axis.

RSI 5-Day Extreme Close Range Optimization Short Thresh 1-1-2000 - 12-29-2012

Short Threshold

RSI 5-Day Extreme Close Range Optimization Cover Thresh 1-1-2000 - 12-29-2012

Cover Threshold

There is another small hilly region near the middle. I chose 55 as my short threshold and 40 as my cover threshold since they are round numbers within the hilly region.

The peculiarity of the long only side of the system does not seem to exist on the short side.

Here is the optimized equity curve with a system of the following rules:

  • Buy RSI < 40
  • Sell RSI > 55
  • Cover RSI < 40
  • Short RSI > 55

RSI 5-Day Extreme Close Range Optimization Equity Curve 1-1-2000 - 12-29-2012

The equity curve looks similar to that of many mean-reversion trading systems.

To check for robustness, I tested this system on multiple ETFs from 1/1/2000 – 12/29/2012.

RSI 5-Day Extreme Close Range ETF Scan 1-1-2000 - 12-29-2012

For further robustness, I tested this system using different lengths of RSI on SPY.

RSI 5-Day Extreme Close Range Length Optimization 1-1-2000 - 12-29-2012

One of my concerns is the success of the system since 2010, since many systems seemed to have performed differently or even completely stopped working from around that period. Here is the performance of the system on multiple markets from 1/1/2010 – 12/29/2012

RSI 5-Day Extreme Close Range ETF Scan 1-1-2010 - 12-29-2012

Cumulative IBS Indicator

Inspired by Larry Connors’ Cumulative RSI(2) (found in this post), and the results of my Cumulative DV2 (found in this post) I decided to test out how a Cumulative IBS indicator would work. The formula for IBS can be found here, and the cumulative IBS is the X-day simple moving average of the IBS. This is a frictionless test on SPY from 1/1/2000 – 12/26/2012. I tested the cumulative IBS using default parameters from the original post I found over IBS (Long if IBS < 45 & Short if IBS > 95).

Equity curves for cumulative 1-9 day IBS. Starts at 1-day in the top left and ends at 9-day on the bottom right. It counts from left to right, meaning that the top middle picture is the cumulative 2-day IBS.

Cum 1-9Day IBS 45 95 1-1-2000 - 12-26-12

Equity curves for cumulative 10-18 day IBS. Follows same structure as above.

Cum 9-18Day IBS 45 95 1-1-2000 - 12-26-12

We can see the equity curves of the cumulative IBS reinforces the conclusion in the cumulative DV2 post.

Here are the individual graphs in anyone is interested:

IBS 45 95 1-1-2000 - 12-26-12

2-day

Cum 2Day IBS 45 95 1-1-2000 - 12-26-12

3-day

Cum 3Day IBS 45 95 1-1-2000 - 12-26-12

4-day

Cum 4Day IBS 45 95 1-1-2000 - 12-26-12

5-day

Cum 5Day IBS 45 95 1-1-2000 - 12-26-12

6-day

Cum 6Day IBS 45 95 1-1-2000 - 12-26-12

7-day

Cum 7Day IBS 45 95 1-1-2000 - 12-26-12

8-day

Cum 8Day IBS 45 95 1-1-2000 - 12-26-12

9-day

Cum 9Day IBS 45 95 1-1-2000 - 12-26-12

10-day

Cum 10Day IBS 45 95 1-1-2000 - 12-26-12

11-day

Cum 11Day IBS 45 95 1-1-2000 - 12-26-12

12-day

Cum 12Day IBS 45 95 1-1-2000 - 12-26-12

13-day

Cum 13Day IBS 45 95 1-1-2000 - 12-26-12

14-day

Cum 14Day IBS 45 95 1-1-2000 - 12-26-12

15-day

Cum 15Day IBS 45 95 1-1-2000 - 12-26-12

16-day

Cum 16Day IBS 45 95 1-1-2000 - 12-26-12

17-day

Cum 17Day IBS 45 95 1-1-2000 - 12-26-12

18-day

Cum 18Day IBS 45 95 1-1-2000 - 12-26-12

Cumulative DV2 Indicator

Inspired by Larry Connors’ Cumulative RSI(2) (found in this post), I decided to test out how a Cumulative DV2 indicator would work. This is a frictionless test on SPY from 1/1/2000 – 12/26/2012. I tested the cumulative DV2 using default parameters (Buy/Cover if DV2 < 50 & Sell/Short if DV2 > 50)

Normal DV2:

DV2 50 1-1-2000 - 12-26-12

2-day cumulative DV2

Cum 2Day DV2 50 1-1-2000 - 12-26-12

3-day cumulative DV2

Cum 3Day DV2 50 1-1-2000 - 12-26-12

4-day cumulative DV2

Cum 4Day DV2 50 1-1-2000 - 12-26-12

5-day cumulative DV2

Cum 5Day DV2 50 1-1-2000 - 12-26-12

6-day cumulative DV2

Cum 6Day DV2 50 1-1-2000 - 12-26-12

7-day cumulative DV2

Cum 7Day DV2 50 1-1-2000 - 12-26-12

8-day cumulative DV2

Cum 8Day DV2 50 1-1-2000 - 12-26-12

9-day cumulative DV2

Cum 9Day DV2 50 1-1-2000 - 12-26-12

10-day cumulative DV2

Cum 10Day DV2 50 1-1-2000 - 12-26-12

11-day cumulative DV2

Cum 11Day DV2 50 1-1-2000 - 12-26-12

The results make me think of one of David Varadi‘s posts (link) about how mean-reversion isn’t necessarily ‘dead’, it has only changed to become mean-reverting on a longer period of time (per the equity charts of the 4-9 day cumulative DV2). An adaptive framework similar to that found at this post by Sanz Prophet could definitely be used.

Equity Curve Feedback

A concept that I thought of while showering a while back was treating an equity curve of a trading system as a tradeable security. It is analogous to using tactical asset allocation, except on trading systems instead of a portfolio of assets. Unfortunately for me, this is not a new idea. I also found this idea while going through the archives of my favourite blog, David Varadi’s CSS Analytics, and at Howard Bandy’s Quantitative Trading Systems in a post titled Equity Curve FeedbackSo far, I’ve been able to think of four ways to apply this idea to a trading system, based on two types of equity curve feedback that I call “soft” and “hard” equity curve feedback.

  • Soft equity curve feedback allows new trades to be entered when a certain equity condition is met.
  • Hard equity curve feedback allows new trades to be entered when a certain equity condition is met AND forces new trades to be undertaken on the second derivative level while mid-trade on the first derivative level.

For example, say you are using an equity curve feedback rule that states that you will only trade when the the equity curve of System XYZ > 15 Day SMA of the equity curve of System XYZ . Your first trade on System XYZ manages to push the equity curve of System XYZ above its 15 Day SMA mid-way through the trade:

  • With soft equity curve feedback entry, you are now allowed to trade System XYZ, but you do not enter the trade mid-way
  • With hard equity curve feedback entry, you are now only allowed to trade System XYZ, but you also immediately enter the mid-way trade

With these two variations, we can come up with four different kinds of equity curve feedback overlays:

  • Soft entry; Soft exit
  • Hard entry; Soft exit
  • Soft entry; Hard exit
  • Hard entry; Hard exit

There are also two (three, but I don’t count one of them) forms of soft exits, but they aren’t different enough for me to classify it as an entirely different form of equity curve feedback.

  • True soft exits – You cannot exit the system until the equity curve feedback condition is met. I do not consider this as a legitimate approach to equity curve feedback, since you are basically barred from exiting your system unless you are lucky.
  • False soft exits – You can exit the system regardless of whether or not the equity curve feedback condition is met. You are not forced to exit your position if the equity curve condition turns from true to false, and you are still allowed to exit your position if the equity curve condition is false.
  • Shorting soft exits – You can exit the system, but only based off of the inverse of your original trading system. For example, say System XYZ from above has the following rules
    • Buy: X > 10
    • Sell: X <10
    • Short: Y > 10
    • Cover: Y <10
    • X and Y are random indicators

    with the same 15-Day crossover equity curve feedback rules as before. You’re using hard entries and you entered in the first trade, but somewhere along the way the equity curve dipped below its 15 Day SMA. Now instead of exiting when X < 10, you exit when Y < 10. This only work if System XYZ has both long and short components, and you allow the shorting of the trading system itself.

From my experience (I’ve only played with it through back-testing, not live money. I’ve also only used simple SMA crossover trading strategies), equity curve feedback doesn’t really improve/detract from total CAGR (sometimes it improves/detracts but usually it maintains CAGR that is roughly similar), but it improves MDD and volatility.