RSI Bounce System

Suthers

Junior member
Messages
22
Likes
3
Hi all, this is my second day on the forum so Ithought I would contribute to the systems section. I have a passion for system design and I'm eager to learn as much as I can and this, in my opinion, is a great way to do that.

I have spent many hours designing and testing short term trading strategies and my experince has shown that finding a large enough edge that will overcome our worst enemies, commission and slippage, is tough to say the least. Persistance does pay, however, and today I will share with you a method that has great potential.

The systems basic premise is to look for overbought and oversold markets and then enter with a unique entry technique, a technique that goes against our natural tendencies, but one that is very powerful. I first came across this concept some time ago through Larry Connors. Larry and his team performed extensive research on a number of indicators and found the RSI to give one of the best edges. The twist, however, was that they were using a 2 period RSI instead of the default 14 period recommended by Welles Wilder, the developer. Results showed that 98 and 2, being overbought and oversold, were the optimal setup areas for the 2 period RSI. I have desigend a number of successful strategies around this concept, one of which I'll share with you today.

This system is a long only system and uses end of day data for all calculations. To start we will filter all stocks by trading those above their 200ma. This boosts system performace and will keep us away from stocks that are in long term down trends. Next, we will look for shares with a 2 period RSI value below 2. What most people do with oversold conditions is look to enter on strength by buying a 2 day breakout or some combination of that, but we are better than most people, and so we will look to enter the following day on even further weakness. Yes, further weakness! We will place orders in the market to buy our setup shares if they drop by 3% from todays close tommorrow.
If the orders are not filled we wait for another setup. The exit strategy, once we are in a trade, is very simple; exit on the close when the close crosses above the 5 period MA of the close. That's it, and it works!

The system logic is sound. We are looking for oversold conditions and take it further by buying at a discount from a minor panic sell off. Once in we look to exit at a premium into strength, prefrably to someone filled with greed. Because our orders run counter to the trend slippage is not a major problem as it is with breakout trading.

I have attched all the testing results. The systems was tested on the S&P500 constituents with constant equity of $100 000 (i.e. no compounding of profits), 0.1% commission, shares were geared 10 times and the financing charges for the leverage at 8%. Risk on each trade is 1%, calculated on 5% of the entry price. This would be very similar to what you could do with equity CFD's.

I am very interested in comments, improvements, ideas etc. Let me know what you think?
 

Attachments

  • Equity Curve.gif
    Equity Curve.gif
    74 KB · Views: 1,798
  • Results.xls
    21 KB · Views: 1,083
  • Sample Entry.jpg
    Sample Entry.jpg
    165 KB · Views: 2,070
Nice one. I've also just started looking at the very short RSI as a tool with promising results. Have you tried juggling position size models on this to see how it handles more aggresive size? (% risk.etc) I'm also a bit curious about what a MonteCarlo simuation would look like against this.

I haven't dusted off my Tradesim for while, so I'm a bit rusty. What portfolio model did you use here?

I'd be interested in calculating a system quality number for this ( Average expectancy x sqrt of number of trades divided by std deviation of R multiples ) If you sent me an export of the trades I'd be happy to do it.


Interesting too, the contrast in duration of winners versus losers.
Winning Trades Losing Trades
3.84 (days) 12.74 (days)
Might be worth doing some MAE/MFE analysis and testing a time stop in conjunction with your risk stop.


Have you tried this on any JSE stocks by any chance?

Thanks for sharing.
 
Last edited:
Thanks for the reply! Before I start I need to own up to a minor school boy error in my testing. Instead of refrencing yesterdays close being greater than it's 200MA, I refrenced it today. This is obviously flawed because we will only know whether that is true after the trading session, not during. Correcting the error dampened performace slightly, so I changed the entry criteria from a 3% drop to a 3.5% drop and included the following entry filter; If today's open is greater than yesterdays close then enter at 3.5% below yesterdays close, otherwise if today's open is less than or equal to yesterdays close enter at 3.5% below todays open. All the performance parameters are improved upon apart from drawdown. Number of trades decrease from 1236 to 973. All the results and equity curve are attached under "amended entries".

I used the % risk model for testing. All entries are positioned off 5% of the entry price, so if I bought at 100 my risk would be 5, and that would be divide into 1% of equity to get the position size. Because I geared the equity 10 times (assuming we're trading CFD's) your risk is magnified by 10, so if a full loss is taken you're actually loosing 10% of your account and not 1%. Because of this the system breaks down around the 2% risk mark. Some people would probaly trade at 0.5%, halving drawdown but also profit, all depends on you and your risk profile.

I ran the system through 5000 Monte Carlo simulations. The results are stable with minimal variance being experienced across the board. I have attached them under "Monte Carlo".

I'm guessing you also use metastock, if you do here is the tradesim formula so you can play around yourself;

EntryTrigger :=Ref(RSI(C,2)<2 AND C>Mov(C,200,S),-1) AND L<=If(O>Ref(C,-1),Ref(C,-1),O)*0.965;
EntryPrice :=If(O>Ref(C,-1),Ref(C,-1),O)*0.965;
ExitTrigger :=C>Mov(C,5,S);
ExitPrice :=C;
InitialStop :=entryprice*0.95;

ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.RecordTrades",
"RSI Bounce,
LONG,
EntryTrigger,
EntryPrice,
InitialStop,
ExitTrigger,
ExitPrice,
START);

System quality number I've of heard of before, I stand to be corrected but I'm sure Van Tharp uses it. I didn't know how it was calculated, so I've allready learnt something new, thanks. If you don't mind I would like to run through the calculation with you, please correct if I'm wrong.

I'm assuming average expectancy = (% profitable*av profit)-(%loosers(av loss)

=(0.7451*9673.33)-(0.2549*9749.59)= 4722.42
or
=(0.7451*1)-(0.2549*1.0078)=0.4881... per unit

The R-multiple dist is attached, and my calculations show the stdev to be 1.210829

therefore systems quality = (0.4881...*sqrt 973)/1.21... =12.57

Ok so something is definitley wrong here. I get a more realistic figure if I divide by the stdev of returns and not r-multiple. To get the r-multpile dist I divide all the returns by 5%, this normalises losses and gains into measures of R-multiples. Is that right? Out of interest if I use the stdev of retruns the SQ number is 2.51, more realistic. I have attached the trade database with my calculations under R-multiples, have a look and let me know what you think.

Lastly, I like your idea of including a time stop. Any trade held over 13 bars is a loss, and the majority of winners occur within 7 bars. Only 14 winners occur after 7 bars so I chose that as the optimal solution. Testing with a time stop at close on the 7th bar doesn't improve performance, I tested from 3 bars up to 10 and no improvement was seen. If you think about it for a second it does make sense, the nature of the exit demands the trade to be exited on strength i.e. c>5ma, so even if the share is a loss when you exit you will be exiting on a up day recouping some of your losses. This seems to do a better job than a timed exit that could be exited on a down day. Does that make sense?

As for MAE and MFE I'll see if I can come up with any solutions.

I traded a variation of this system on the JSE top 40 for 1 year with good success. I now have stopped trading the JSE and concentrate my efforts on the American and Europen exchanges, more liquidity, better spreads etc.

If you want me to e-mail the trade database or anything else let me know. Look forward to hearing you thoughts!
 

Attachments

  • R-Multiples.CSV
    136.1 KB · Views: 541
  • Monte Carlo.xls
    21.5 KB · Views: 890
  • Amended Entry.xls
    22.5 KB · Views: 689
  • Amended Entry.gif
    Amended Entry.gif
    73.3 KB · Views: 792
Last edited:
Hi all, this is my second day on the forum so Ithought I would contribute to the systems section. I have a passion for system design and I'm eager to learn as much as I can and this, in my opinion, is a great way to do that.

I have spent many hours designing and testing short term trading strategies and my experince has shown that finding a large enough edge that will overcome our worst enemies, commission and slippage, is tough to say the least. Persistance does pay, however, and today I will share with you a method that has great potential.

The systems basic premise is to look for overbought and oversold markets and then enter with a unique entry technique, a technique that goes against our natural tendencies, but one that is very powerful. I first came across this concept some time ago through Larry Connors. Larry and his team performed extensive research on a number of indicators and found the RSI to give one of the best edges. The twist, however, was that they were using a 2 period RSI instead of the default 14 period recommended by Welles Wilder, the developer. Results showed that 98 and 2, being overbought and oversold, were the optimal setup areas for the 2 period RSI. I have desigend a number of successful strategies around this concept, one of which I'll share with you today.

This system is a long only system and uses end of day data for all calculations. To start we will filter all stocks by trading those above their 200ma. This boosts system performace and will keep us away from stocks that are in long term down trends. Next, we will look for shares with a 2 period RSI value below 2. What most people do with oversold conditions is look to enter on strength by buying a 2 day breakout or some combination of that, but we are better than most people, and so we will look to enter the following day on even further weakness. Yes, further weakness! We will place orders in the market to buy our setup shares if they drop by 3% from todays close tommorrow.
If the orders are not filled we wait for another setup. The exit strategy, once we are in a trade, is very simple; exit on the close when the close crosses above the 5 period MA of the close. That's it, and it works!

The system logic is sound. We are looking for oversold conditions and take it further by buying at a discount from a minor panic sell off. Once in we look to exit at a premium into strength, prefrably to someone filled with greed. Because our orders run counter to the trend slippage is not a major problem as it is with breakout trading.

I have attched all the testing results. The systems was tested on the S&P500 constituents with constant equity of $100 000 (i.e. no compounding of profits), 0.1% commission, shares were geared 10 times and the financing charges for the leverage at 8%. Risk on each trade is 1%, calculated on 5% of the entry price. This would be very similar to what you could do with equity CFD's.

I am very interested in comments, improvements, ideas etc. Let me know what you think?

Hello Suthers,

I'm a bit confused with your exit criteria and would welcome some clarification.

The system is a LONG System yet you wait until the Close crossed ABOVE the 5MA(Close) before exiting? Surely this would be classed as a Profit Stop?

If I have understood this correctly, then how do you manage risk in the trade. In otherwords how do you know when to get out of a losing position?

The trade could continue to fall and, as such, the close could not rise above the 5MA for quite a while yet with your current rules the trade would still remain open.

Thanks in advance,

Chorlton
 
I tried to have a look at this using my own screener software and could not find any stocks that match. I think there are two different ways of calculating RSI floating around - the classic Wilder method and a more recent method. A quick Google came up with this reference

Investor/RT Tour - Relative Strength Index (RSI)

I am using the original Wilder method. I would be interested to know what method Metastock is using.
 
There is a risk of "survivorship bias" unless you are using the historical constituents of the SPX. This may or may not be significant, but as the system is based upon buying grossly oversold stocks, there may be some chance that it does have some significance.
 
Hello Suthers,

I'm a bit confused with your exit criteria and would welcome some clarification.

The system is a LONG System yet you wait until the Close crossed ABOVE the 5MA(Close) before exiting? Surely this would be classed as a Profit Stop?

If I have understood this correctly, then how do you manage risk in the trade. In otherwords how do you know when to get out of a losing position?

The trade could continue to fall and, as such, the close could not rise above the 5MA for quite a while yet with your current rules the trade would still remain open.

Thanks in advance,

Chorlton

Hi Chorlton,

You have understood the system rules correctly and your concern is a valid one. Testing the system with a stop loss impairs performace considerably so I opted to control risk through my position size instead. The way I do that is by basing my risk threshold on the worst loss experienced historically. In this case you would be looking at around the -30% mark. Because I use 5% of the entry price to position myself if that loss was experienced in real trading on a 1 % risk basis with leverage you would loose 60% of your account. (30%/5%=6 and assuming gearing of 10, CFD's, multiply by 10= -60%) This would be a rare experience but one that is possible. If you are not comfortable taking that sort of risk then all you have to do is change your position size. As an example if you decided to limit your worst case loss to 20% of capital then you would risk 0.33% on every trade instead of 1%. (30%/5%=6 and 6*0.33=2 and because of leverage 2*10 = 20%). In a nutshell you will be basing your risk on the worst loss in past performace. The vast majority of your losses will be far below 30% and therefore way below 20% of equity.

My reasoning for this mehtod is simple. You are buying an extremley oversold share and so the odds strongly favour one or two up days, which would be enough to signal an exit. Also a quick look at the MAE's of the trades and the final profit or loss is very revealing. Most trades have MAE's much lower than the final posted profit or loss. As an example one trade dropped by 25% and then ended with a 6% profit, had you employed a stop loss you would have guaranteed a loss with no chance of profit. This happens over and over again with the majority of trades exiting higher than there worst drops during the trade. I also can't handle exiting trades on a stop loss breach only to watch it go shooting up the next day.

If this still bothers you then you could include a 15 day time stop, 99.5% of the trades in the database exit at 15 days or less. There are many options, another would be to shorten the 5ma to a 2ma therefore only requiring a close above yesterdays and ensuring quicker exits but less profits. Everything is a tradeoff in system design and it all depends on you.

Lastly, all the research I've done with short term systems share a common trait; stop losses impair system performace. I have nothing against them and understand all their benefits but time and time again they've proven to hamper results. It really depends on you, I prefer to trade without stops but that may not be comfortable for you.

Hope this helps and thanks for your post.

Suthers
 
Last edited:
I tried to have a look at this using my own screener software and could not find any stocks that match. I think there are two different ways of calculating RSI floating around - the classic Wilder method and a more recent method. A quick Google came up with this reference

Investor/RT Tour - Relative Strength Index (RSI)

I am using the original Wilder method. I would be interested to know what method Metastock is using.

Metastock uses the original wilder method. I created the indicator myself and compared it to the bulit in RSI indicator to double check and they aline perfectly. The up and down days are smooothed with wilders smooothing and the normal RSI calculation is then performed. I have included the metastock code for the RSI I created to compare below.

u:=Wilders(If(C>Ref(C,-1),C-Ref(C,-1),0),2);
d:=Wilders(If(C<Ref(C,-1),Ref(C,-1)-C,0),2);

100-(100/(1+u/d))

I'm not sure why you're having a problem. Data can be an issue but not to the extent that no trades line up. Try again and if you're still having trouble I'd be happy to help you figure it out.

The issue of survivorship bias can obviously be a problem, thanks for bringing it up. Testing a system on current index constituents, like the SP500, would not include those stocks that delisted etc. I'm not sure where you would obtain a database that includes all listed and delisted SP500 constituents, but testing the system on that sort of database would be the best case scenario.

To get around this issue you could test the system on out of sample data. I took the liberty of doing that and have attached the results. The data I used is from the S&P MidCap 400 index constituents. The system was not designed on any of these stocks so the test is significant. The results drop off a bit but still included an accuracy above 70% with roughly the same profitability. This should help to boost confidence in the system and is statistically significant.

Thanks for the post
 

Attachments

  • Equity Curve.gif
    Equity Curve.gif
    71.6 KB · Views: 996
  • Out of sample S&P Midcap400.xls
    22.5 KB · Views: 516
  • SP Midcap trade database.CSV
    106.4 KB · Views: 531
Last edited:
Hi Chorlton,

You have understood the system rules correctly and your concern is a valid one. Testing the system with a stop loss impairs performace considerably so I opted to control risk through my position size instead. The way I do that is by basing my risk threshold on the worst loss experienced historically. In this case you would be looking at around the -30% mark. Because I use 5% of the entry price to position myself if that loss was experienced in real trading on a 1 % risk basis with leverage you would loose 60% of your account. (30%/5%=6 and assuming gearing of 10, CFD's, multiply by 10= -60%) This would be a rare experience but one that is possible. If you are not comfortable taking that sort of risk then all you have to do is change your position size. As an example if you decided to limit your worst case loss to 20% of capital then you would risk 0.33% on every trade instead of 1%. (30%/5%=6 and 6*0.33=2 and because of leverage 2*10 = 20%). In a nutshell you will be basing your risk on the worst loss in past performace. The vast majority of your losses will be far below 30% and therefore way below 20% of equity.

My reasoning for this mehtod is simple. You are buying an extremley oversold share and so the odds strongly favour one or two up days, which would be enough to signal an exit. Also a quick look at the MAE's of the trades and the final profit or loss is very revealing. Most trades have MAE's much lower than the final posted profit or loss. As an example one trade dropped by 25% and then ended with a 6% profit, had you employed a stop loss you would have guaranteed a loss with no chance of profit. This happens over and over again with the majority of trades exiting higher than there worst drops during the trade. I also can't handle exiting trades on a stop loss breach only to watch it go shooting up the next day.

If this still bothers you then you could include a 15 day time stop, 99.5% of the trades in the database exit at 15 days or less. There are many options, another would be to shorten the 5ma to a 2ma therefore only requiring a close above yesterdays and ensuring quicker exits but less profits. Everything is a tradeoff in system design and it all depends on you.

Lastly, all the research I've done with short term systems share a common trait; stop losses impair system performace. I have nothing against them and understand all their benefits but time and time again they've proven to hamper results. It really depends on you, I prefer to trade without stops but that may not be comfortable for you.

Hope this helps and thanks for your post.

Suthers

Hello Suthers,

Thanks for the detailed reply. You have definately answered my question....

All the best,

Chorlton
 
There is a risk of "survivorship bias" unless you are using the historical constituents of the SPX. This may or may not be significant, but as the system is based upon buying grossly oversold stocks, there may be some chance that it does have some significance.

I was going to type exactly the same response until I read this. Any thoughts, suthers? (Edit - I see you have responded above, though I would still be concernd about this? Anyone have any ideas about an historical list of constituents?

I'm going to try and code this into amibroker and play about / contribute - as much as a play thing to get me using the software. I hope to contribute more.

UTB
 
Last edited:
I was going to type exactly the same response until I read this. Any thoughts, suthers? (Edit - I see you have responded above, though I would still be concernd about this? Anyone have any ideas about an historical list of constituents?

I'm going to try and code this into amibroker and play about / contribute - as much as a play thing to get me using the software. I hope to contribute more.

UTB

Thanks for the post. Premium data do sell data that includes all delisted stocks for the US markets. If anyone knows where to obtain a list of previously included SP500 constituents then I would easily be able to create a filter to extract those stocks that are now not apart of the SP500 from the delisted database and include them in the simulation.
I would be very interested to see what sort of results we'd with the inclusion of the delisted stocks. I'll e-mail premium data and see if they have any ideas, if anyone else has an idea I would love to hear it.
 
Thanks for the post. Premium data do sell data that includes all delisted stocks for the US markets. If anyone knows where to obtain a list of previously included SP500 constituents then I would easily be able to create a filter to extract those stocks that are now not apart of the SP500 from the delisted database and include them in the simulation.
I would be very interested to see what sort of results we'd with the inclusion of the delisted stocks. I'll e-mail premium data and see if they have any ideas, if anyone else has an idea I would love to hear it.

I've scratched up a code and tested on all constituents (about 8,000 stocks) and it tested well - I'll post details later.

I plan to work on optimising a few of the parameters and performing some walk forward testing to see how this system had adapted over time. Being a newbie to Amibroker and just catcthing up with other things after holidays, I'm not sure how long this might take.

Have you looked at optimising / walk forward tests?

UTB
 
I've scratched up a code and tested on all constituents (about 8,000 stocks) and it tested well - I'll post details later.

I plan to work on optimising a few of the parameters and performing some walk forward testing to see how this system had adapted over time. Being a newbie to Amibroker and just catcthing up with other things after holidays, I'm not sure how long this might take.

Have you looked at optimising / walk forward tests?

UTB

Hello Blades,

Ah... a fellow Amibroker user !!! :cheesy: I'm also a newbie to AB but definately prefer it to MS. How are you finding it?

Out of interest, I was going to create an AB thread where we could discuss the software, coding problems, etc.

Regards,

Chorlton
 
Hello Blades,

Ah... a fellow Amibroker user !!! :cheesy: I'm also a newbie to AB but definately prefer it to MS. How are you finding it?

Out of interest, I was going to create an AB thread where we could discuss the software, coding problems, etc.

Regards,

Chorlton

Hello Chorlton,

I like what I've seen so far. I've had it for about 3 years and not really used it. I'm now doing this "full time" so intend to start learning from here.

I take it you've found the yahoo group - very active and probably means a thread on here wouldn't add anything?

UTB
 
I've scratched up a code and tested on all constituents (about 8,000 stocks) and it tested well - I'll post details later.

I plan to work on optimising a few of the parameters and performing some walk forward testing to see how this system had adapted over time. Being a newbie to Amibroker and just catcthing up with other things after holidays, I'm not sure how long this might take.

Have you looked at optimising / walk forward tests?

UTB

Unfortunatley my software doesn't allow for optimisation. I have however manully optimised over a number of parameters and it would seem the current parameters are fairly optimal. I may be wrong so will be interested in your findings.
 
Unfortunatley my software doesn't allow for optimisation. I have however manully optimised over a number of parameters and it would seem the current parameters are fairly optimal. I may be wrong so will be interested in your findings.

rough as a bear's **** so far - here's my results from tests on all stocks from 1999 to present - 5 positions allowable at any time.

There'll be some guff in all this - hopefully I'll work through it and weed it out - but the results may open up the discussion.

UTB
 

Attachments

  • RSI bounce - Backtest Report.htm
    8.6 KB · Views: 666
  • rsi bounce portfolio.csv
    84.4 KB · Views: 397
rough as a bear's **** so far - here's my results from tests on all stocks from 1999 to present - 5 positions allowable at any time.

There'll be some guff in all this - hopefully I'll work through it and weed it out - but the results may open up the discussion.

UTB

Hi Blades,

Are you able to run a Monte Carlo test on the results? Also, out of interest, what does the AB code look like?

PS. In answer to your previous question, yes I do use Yahoo forum but sometimes I've found the responses are not always that helpful. However, on the whole, it is a very good place to get help.

All the best,

Chorlton
 
Hi Blades,

Are you able to run a Monte Carlo test on the results? Also, out of interest, what does the AB code look like?

PS. In answer to your previous question, yes I do use Yahoo forum but sometimes I've found the responses are not always that helpful. However, on the whole, it is a very good place to get help.

All the best,

Chorlton


Chorlton,

I think I can do some monte-carlo type stuff later.

My problem is I don't understand the coding yet - I'm patching things together and learning on the hop. Are you an experienced programmer of Amibroker?

I'll post some code later to be laughed at.

The good news - I#'ve wrtiien in some optimisation variables and it's working

Teh bad news - it takes 2 hours on my pc. I've fired it up on all available data - so will need to run it again up to the end of 2005 and leave the rest of the data to be tested out of sample.

FWIW, I'll post the results up of the first optimisation series. I've optimised the MA length from 150 to 250m in steps of 50, the RSI period and value from 2 to 3, and the MA close from 4 - 6. Gives 36 runs of about 8 minutes each!

UTB
 
Chorlton,

I think I can do some monte-carlo type stuff later.

My problem is I don't understand the coding yet - I'm patching things together and learning on the hop. Are you an experienced programmer of Amibroker?

I'll post some code later to be laughed at.

The good news - I#'ve wrtiien in some optimisation variables and it's working

Teh bad news - it takes 2 hours on my pc. I've fired it up on all available data - so will need to run it again up to the end of 2005 and leave the rest of the data to be tested out of sample.

FWIW, I'll post the results up of the first optimisation series. I've optimised the MA length from 150 to 250m in steps of 50, the RSI period and value from 2 to 3, and the MA close from 4 - 6. Gives 36 runs of about 8 minutes each!

UTB

Hi Blades,

No, I'm definately not an experienced AB coder. I've only been using it for 6mths although I have managed to code up a few fairly straightforward systems using AFL.

If you want to post the code up, I'll try and cast my eye over it if you need any assistance. Afterall, Two heads are better than one and all that... ;)

All the best,

Chorlton
 
I'm guessing you also use metastock, if you do here is the tradesim formula so you can play around yourself;

EntryTrigger :=Ref(RSI(C,2)<2 AND C>Mov(C,200,S),-1) AND L<=If(O>Ref(C,-1),Ref(C,-1),O)*0.965;
EntryPrice :=If(O>Ref(C,-1),Ref(C,-1),O)*0.965;
ExitTrigger :=C>Mov(C,5,S);
ExitPrice :=C;
InitialStop :=entryprice*0.95;

Hi Suthers,

I decided to go back over this thread as I only brushed over it while I was at work. On closer examination, I picked up a few other things which confused me and would welcome some clarification.

Your ExitPrice is defined at the CLOSE. However, at this is a EOD system, you will only be aware that price has risen above the Moving Average once the Mkt is closed so surely the exit price would be the OPEN of the next day?
 
Top