Saturday, May 24, 2008

More RSI(2)

Following is some extra-curricular research I have been working on regarding RSI(2) as a short-term mean recursion system in conjunction with several other bloggers.

Woodshedder
Dogwood
Skill Analytics

The following looks at two conditions on my 3 standard test portfolios + a leveraged long and short portfolio of ETFs. The ETFs test back as far as there is data for them and the stock portfolios test back 20-years to 01/01/1988. Each trade is $10,000. No money management, slippage, commissions, etc. have been used.

The left most column is RSI(2) value used in a <= condition.
PF=Profit Factor
EDR=AverageTrade/AverageLoss
EER=EDR/Avg. Days in Winning Trades.

I will continue to append this post as more research is done. As this system is basically looking to catch short term corrections and stay out of breakdowns. As such, there are a few other conditions I will testing including: A) Testing for diminishing volume on the pullback that sets up the RSI<=X condition. B) Testing to make sure the longer-term trend is still intact with Bollinger bands, n-day lows and additional longer-term moving averages.


Condition 1:
Entry: 50-day Avg Vol >= 100,000 shares
RSI <= X
Exit:
RSI >= 80


Condition 2:
Entry:
50-day Avg Vol >= 100,000 shares
RSI <= X
Close >= 50-day sma
Exit:
RSI >= 80


Chart of results:

Notes: I believe the catawampus curve on the ETFs is due to the relatively few samples. I also tried requiring the RSI(2) to be below the threshold for two consectuve days but that didn't really help things, which suggest if you do not get an immediate bounce, you could be looking at a breakdown. This sets up the possibility that the addition of a 1-day timed stop if RSI(2) stays below your threshold could help keep you out of trouble.





Money Management Tests
For these, I added a 12% protective stop that was used for percent risk money management in addition to Condition 2 entry and exits using RSI<=10. Tests were run on leveraged ETF portfolio. Risking 5% of equity per trade:
Start Size $10,000.00
First Equity Date 09/01/06
Last Equity Date 05/19/08
Number of years 1.7139

Return Over Period 111.83%
AnnualReturn 65.25%
Compound Annual Growth Rate 54.96%

Percent Maximum Drawdown 15.53%
Date of Maximum Drawdown 12/10/07

Date of the Longest Time Between Peaks 06/11/07
Longest time between peaks 117 days
Average time between peaks 43 days 10:17

Sharpe Ratio 1.8545
MAR 3.5386

Risking 10% of Equity Per Trade

Start Size $10,000.00
First Equity Date 09/01/06
Last Equity Date 05/19/08
Number of years 1.7139

Return Over Period 321.45%
AnnualReturn 187.56%
Compound Annual Growth Rate 131.48%

Percent Maximum Drawdown 29.15%
Date of Maximum Drawdown 12/10/07

Date of the Longest Time Between Peaks 06/11/07
Longest time between peaks 117 days
Average time between peaks 43 days 10:17

Sharpe Ratio 1.9035
MAR 4.5099

I have posted a Trade by Trade report HERE for the 10% risked per trade model

NOTE: Damian pointed out that the percent risk model is becoming over-leveraged on 8/27 when multiple signals are triggered. I hadn't caught it yet - thanks. Need to look into some methods of trade selection/rejection when multiple signals received. This is a problem with percent risk position sizing as situations can occur when a risk allocation can actually have you purchase more positions that available equity will allow. Rather than pull it down, I will leave this up as an example of good collaboration at work. In real-time, I would probably backtest signals and take the best-performing one. There is a way to do this with "virtual trades" in Trader's Studio but I don't know how to code it - yet.

16 comments:

Damian said...

Interesting stuff - did you get my email asking two questions?

1. What are the components of the ETF portfolio?

2. I noticed before you were using TS_PERCENTRISK a trading plan - can you give any idea what the code is for that?

The testing blog connection continues!

bhh said...

The ETF components are:
DDM
DIG
MVV
QLD
RMM
ROM
RRY
RSU
RXL
SAA
SSO
UCC
UGE
UKF
UKK
UKW
UPW
URE
USD
UVG
UVT
UVU
UWM
UXI
UYG
UYM
DUG
DXD
EEV
EFU
EWV
FXP
MZZ
QID
REW
RMS
RRZ
RSW
RXD
SCC
SDD
SDK
SDP
SDS
SFK
SIJ
SJF
SJH
SJL
SKF
SKK
SMN
SRS
SSG
SZK
TWM

I added the liquidity condition to the code itself rather than screening it out of the etfs.

i used this screener to generate the list of only leveraged and leveraged short etfs:
http://etfscreen.com/screener.php

bhh said...

sorry, i didn't get the email, I am having problems with that verizon one. I am adding one to my blog now so if you email me at that one, I will email you the trade plan. It is a standard one that shipped with V2.5

Jeff said...

B- starting to get slightly better results adding this:

If a trade is on:
the exit trigger ((RSI(2) > 80)) has not yet been hit,
and the RSI(2) crosses below 70, then sell next bar at market.

I haven't worked at optimizing it at all.

Also, adding 12% stop is giving could results for the drawdown with minimal impact to net profit.

Right now, I'm just working on the $INDU, past 30 years.

Damian said...

You guys using any maximum positions?

Jeff said...

Damian, I'm not sure what you are asking.

Damian said...

What's the maximum number of positions your system can take? In other words, if your system can take a maximum of, say, 5 positions, then you'd probably do Total Equity/5.

Just wondering if you guys are testing that way.

Jeff said...

Damian, I've been using only one position with testing done on Tradestation.

When testing with Stockfetcher, I get the best results with 3 positions, but the drawdowns are formidable. Allowing a total of 6 positions still gives good returns and mitigates some of the drawdown pain.

I've only been testing the ETFs bhh has posted above with Stockfetcher. I have not been working with individual equities.

bhh said...

For these tests, I am buying 10,000 worth per trade, no cap.
Shares=10000/TSClose.

At the Trade Plan level, I tend to use percent risk money managment rather than equal equity. We can test it both ways though.

bhh said...

I'll elaborate on this for a minute because my process may seem a bit ambiguous. When testing basic system components, I try and keep it as pure as possible with as few variables as possible so I really understand what each component does and to prevent system bloat and keep things as simple as possible. The 10000/TSClose I am using for this or the 1000/TSClose I normally use makes it easy to read % returns as well. Once a system is “done”, I will only then look at money management strategies to best exploit a system’s strengths and weaknesses.

I tend to prefer percent risk money management and for trend following systems, normally only allow 1% risk per trade. For a mean recursion system, I may use more risk per trade as the win% is much higher. I will have to see once I get there – I haven’t really tested with money management yet. For the one test I posted on Woodshedder’s blog the other night, I just used the full price as the amount at risk because there was no protective stop in place yet and allocated 100% risk to each trade – sort of a quick best/worse case scenario but the drawdowns weren’t terrible bad and the Sharpe ratio was good. I will look at some protective stops today.

bhh said...

I think I am going to take 10% of my working capital and start test trading this at 5% risk starting on tuesday. That puts only 1/2% of my total capital at risk on any single trade. If things work out ok in real-time, I will ramp that up to 10% of 10% (1% total) soon and may eventually allocate up to 25% of my working capital toward this based on real-time performance.

Jeff said...

B- good stuff. As you probably know, I have been trading the system for a week now and will be tracking the results on Covestor. I'm going to keep the position sizes small until I decide if I will use any stop protection.

One question. On the tests I have run, I'm showing worse drawdowns and decreased annual returns due to the system invariably holding QLD in January.

In your trade lists, the system does not have you in QLD in January. I'm wondering how it avoided it? For fun, run the test with QLD in it. Its ugly.

bhh said...

Wood,
I mis-typed the original post, I was using condition 2 which only takes trades who's close is above the 50-day MA - and skipped all those trades where QLD was breaking down in Jan. because it was trading beneath it's 50-day MA. I was rushing this morning to get everything posted before brunch and made some typos. That is what makes this blog collaboration so great is that you have someone checking everything!

Jeff said...

Very cool. That one condition, close > 50dma, might be the one fix for drawdowns that I've been testing for for hours over the past few days.

By the way, I'm not having much luck with time stops. It decreases the returns but doesn't seem to minimize the drawdowns like I had hoped. I'm curious to see what you find out in that area.

Anonymous said...

you guys can try a time stop of 6 or 7 days after you enter on long side. thanks for all the research

Anonymous said...

Hello,

I have been reading this blog over the past couple of days. I have a couple comments/suggestions/questions for all of the RSI studies I have read so far.

First, I traded for about 3 years using RSI for about 3 years with mixed results. I would be happy to post charts, trades, etc if you are interested of actual trading using RSI systems.

Second, I like the idea of using ETFs for a couple of reasons. Backtesting RSI for stocks is so misleading. You end up catching a lot of falling knives that would not show up in backtest simply because the stocks do not exist any more for whatever reason. ETFs are more consistent. I even tried different kinds of large baskets believing diversity would help, but in the end you still catch falling knives. It is amazing how few of these it takes to wipe out all of your profit.

Third, based on my experience Stops more often limit your gain then prevent your loss. Maybe the best approach I found was a time based exit, if your first exit criteria is not met, as your research shows.

Forth, I see you have some Ultra ETFs. I wonder if their returns are any different better or worse? Although I realize the data will be limited as they are newer.

And last, how many trades are you getting per day using these ETFs? One thing I found that helped me when I had more signals than capital was to use the stock with the lowest RSI. This may not be an issue, but it would be interesting to see how it played out in backtesting if this ever happened.

I hope this helps, I will keep reading your blog, and I look forward to your future post.

Good luck!