rsi

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

Advertisements

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.

DV2 Further Research

In this post I will test the DV2 with other indicators.

First I tested a simple DV2 system on SPY from 1/1/2000 – 7/30/2012 from Yahoo! Finance data. The rules were:

  • Buy/Cover: DV2 < 50
  • Sell/Short: DV2 > 50

The orders were taken at the day the signal was generated at the close price. The results were:

  • CAGR: 24.08
  • MDD: 42.67

All the tests after this use the same test dates, data source etc. as the test above.

DVI

The rules are:

  • Buy: DV2 < 50 & DVI < 50
  • Sell: DV2 > 50
  • Short: DV2 > 50 & DVI > 50
  • Cover: DV2 < 50

The results:

  • CAGR: 22.40%
  • MDD: 20.88%

These set of rules decrease the CAGR slightly yet decrease the MDD by over half.

A different variation of the rules:

  • Buy: DV2 < 50 & DVI < 50
  • Sell: DVI > 50
  • Short: DV2 > 50 & DVI > 50
  • Cover: DVI < 50

The results:

  • CAGR: 18.14%
  • MDD: 27.67%

Performance deteriorated versus the test above yet still beat the original on a risk/reward basis.

A different variation:

  • Buy/Cover: DV2 < 50 & DVI < 50
  • Sell/Short: DV2 > 50 & DVI > 50

The results:

  • CAGR: 15.73%
  • MDD: 27.67%

Performance deteriorated more.

A different variation:

  • Buy: DV2 < 50 & DVI < 50
  • Sell: DV2 > 50 | DVI > 50
  • Short: DV2 > 50 & DVI > 50
  • Cover: DV2 < 50 | DVI < 50

The results:

  • CAGR: 22.76%
  • MDD: 20.88%

A different variation:

  • Buy: DV2 < 50 | DVI < 50
  • Sell: DV2 > 50 | DVI > 50
  • Short: DV2 > 50 | DVI > 50
  • Cover: DV2 < 50 | DVI < 50

The results:

  • CAGR: 22.86%
  • MDD: 27.67%

A different variation:

  • Buy: DV2 < 50
  • Sell: DV2 > 50 | DVI > 50
  • Short: DV2 > 50
  • Cover: DV2 < 50 | DVI < 50

The results:

  • CAGR: 22.37%
  • MDD: 20.88%

IBS (or CRTDR)

I found this indicator with some background information at this QUSMA post. It seemed to be useful as an indicator on its own, and as a filter for other indicators. Just like in the QUSMA post, I use a 3-Day MA of the IBS.

The rules are:

  • Buy: DV2 < 50 & IBS < 50
  • Sell: DV2 > 50
  • Short: DV2 > 50 & IBS > 50
  • Cover: DV2 < 50

The results:

  • CAGR: 24.72%
  • MDD: 26.70%

A different variation of the rules:

  • Buy: DV2 < 50 & IBS < 50
  • Sell: IBS > 50
  • Short: DV2 > 50 & IBS > 50
  • Cover: IBS < 50

The results:

  • CAGR: 24.59%
  • MDD: 27.44%

A different variation:

  • Buy/Cover: DV2 < 50 & IBS < 50
  • Sell/Short: DV2 > 50 & IBS > 50

The results:

  • CAGR: 24.42%
  • MDD: 31.22%

A different variation:

  • Buy: DV2 < 50 & IBS < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50 & IBS > 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 25.38%
  • MDD: 19.79%

A different variation:

  • Buy: DV2 < 50 | IBS < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50 | IBS> 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 25.24%
  • MDD: 20.33%

A different variation:

  • Buy: DV2 < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 24.44%
  • MDD:  26.70%

RSI(2)

The rules are:

  • Buy: DV2 < 50 & RSI < 50
  • Sell: DV2 > 50
  • Short: DV2 > 50 & RSI > 50
  • Cover: DV2 < 50

The results:

  • CAGR: 21.92%
  • MDD: 35.00%

A different variation of the rules:

  • Buy: DV2 < 50 & IBS < 50
  • Sell: IBS > 50
  • Short: DV2 > 50 & IBS > 50
  • Cover: IBS < 50

The results:

  • CAGR: 19.28%
  • MDD: 28.34%

A different variation:

  • Buy/Cover: DV2 < 50 & IBS < 50
  • Sell/Short: DV2 > 50 & IBS > 50

The results:

  • CAGR: 20.48%
  • MDD: 33.70%

A different variation:

  • Buy: DV2 < 50 & IBS < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50 & IBS > 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 20.93%
  • MDD: 30.02%

A different variation:

  • Buy: DV2 < 50 | IBS < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50 | IBS> 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 23.02%
  • MDD: 30.13%

A different variation:

  • Buy: DV2 < 50
  • Sell: DV2 > 50 | IBS > 50
  • Short: DV2 > 50
  • Cover: DV2 < 50 | IBS < 50

The results:

  • CAGR: 21.88%
  • MDD:  35.01%

Conclusion:

While all the indicators improved the Risk/Reward versus the vanilla DV2 system, the best indicator seemed to be the IBS.