RSI Bounce System

OK, something doesn't add up.

When I test this on the FTSE250 list I have, my results show a CAR of 25% and a RAR of 190% and a sharp of >3.

I've tested this up until present day - with just about all trades taking place for 2003 onwards.

There's been a big drawdown which I suspect corresponds with drops in the index - might suggest this strategy works best in a bull market and the 250 moved a lot in the upward phase of the equity curve.

Lack of trades prior to 2003 could match my lack of data during this period.

Equity attched.

Chorlon / Suthers- could you test this on more recent data - maybe 2003 to present and see if your results more match mine?

Cheers,
UTB

Blades,

The initial code I used for testing was basically Suthers code but re-worked into AFL. The results when backtested from 98-04 were to say AMAZING!!! The MaxDD was still (IMO) untradable at around 25% from memory, but the returns were unbelievable!!

Impressive initial results are always a warning sign for me, and as a result I decided to investigate further. I re-wrote the code (as per my recent posting) and the results were, this time, very poor. In my case I suspect the problem was with the Buy Price.

I shall use my code and quickly backtest from Jan2003 to May2008 (inclusive) and post results. Watch this space....

Chorlton
 
Blades / Suthers,

Can I ask what Position Sizing model and associated parameter values you are using?
 
Okay... Here are the results:

Mrkt: FTSE250, TimeFrame: DAILY, Date Range: 01/01/03-31/05/08

Trade Parameters and Preferences

Trade Parameters

Initial Capital:
$100,000.00

Portfolio Limit:
100.00%

Maximum number of open positions:
100

Position Size Model:
Fixed Percent Risk

Percentage of capital risked per trade:
1.00%

Position size limit:
10.00%

Portfolio Heat:
100.00%

Pyramid profits:
No

Transaction cost (Trade Entry):
$15.00

Transaction cost (Trade Exit):
$15.00

Margin Requirement:
100.00%

Magnify Position Size(& Risk) according to Margin Req:
No

Margin Requirement Daily Interest Rate (Long Trades):
0.0000%

Margin Requirement Yearly Interest Rate (Long Trades):
0.0000%

Margin Requirement Daily Interest Rate (Short Trades):
0.0000%

Margin Requirement Yearly Interest Rate (Short Trades):
0.0000%



Trade Preferences

Trading Instrument:
Stocks

Break Even Trades:
Process separately

Trade Position Type:
Process all trades

Entry Order Type:
Default Order

Exit Order Type:
Default Order

Minimum Trade Size:
$0.00

Accept Partial Trades:
No

Volume Filter:
Ignore Volume Information

Pyramid Trades:
No

Use Level Zero trades only:
Yes

Detailed Report


Trade Summary

Earliest Entry Date in the Trade Database:
29/01/2003

Latest Entry Date in the Trade Database:
2/05/2008

Earliest Exit Date in the Trade Database:
11/02/2003

Latest Exit Date in the Trade Database:
7/05/2008

Start Trade Entry Date:
29/01/2003

Stop Trade Entry Date:
2/05/2008

First Entry Date:
29/01/2003

Last Entry Date:
2/05/2008

First Exit Date:
11/02/2003

Last Exit Date:
7/05/2008

Total Trading duration:
1925 days

Profit Summary

Profit Status:
PROFITABLE

Starting Capital:
$100,000.00

Finishing Capital:
$125,380.42

Maximum Equity/(Date):
$25,380.42 (7/05/2008)

Minimum Equity/(Date):
-$924.14 (25/03/2003)

Gross Trade Profit:
$39,332.40 (39.33%)

Gross Trade Loss:
-$13,951.98 (-13.95%)

Total Net Profit:
$25,380.42 (25.38%)

Average Profit per Trade:
$220.70

Profit Factor:
2.8191

Profit Index:
64.53%

Total Transaction Cost:
$3,450.00

Total Slippage:
$0.00

Total Trade Interest:
$0.00

Daily Compound Interest Rate:
0.0118%

Annualized Compound Interest Rate:
4.3819%


Trade Statistics

Trades Processed:
131

Trades Taken:
115

Partial Trades Taken:
0

Trades Rejected:
16

Winning Trades:
83 (72.17%)

Losing Trades:
32 (27.83%)

Breakeven Trades:
0 (0.00%)


Largest Winning Trade/(Date):
$1,414.82 (7/02/2006)

Largest Losing Trade/(Date):
-$1,340.35 (11/05/2004)

Average Winning Trade:
$473.88

Average Losing Trade:
-$436.00

Average Win/Average Loss:
1.0869


Trade Duration Statistics
Winning and Losing Trades
Winning Trades
Losing Trades

Maximum Trade Duration:
22 (days)
14 (days)
22 (days)

Minimum Trade Duration:
1 (days)
1 (days)
1 (days)

Average Trade Duration:
5.92 (days)
5.66 (days)
6.59 (days)

Consecutive Trade Statistics

Maximum consecutive winning trades:
17

Maximum consecutive losing trades:
7

Average consecutive winning trades:
4.88

Average consecutive losing trades:
1.88


Trade Expectation Statistics

Normalized Expectation per dollar risked:
$0.43

Maximum Reward/Risk ratio:
2.75

Minimum Reward/Risk ratio:
-2.60

Average Positive Reward/Risk ratio:
$0.92

Average Negative Reward/Risk ratio:
-$0.85

Relative Drawdown

Maximum Dollar Drawdown/(Date):
$3,394.32 (23/05/2006)

Maximum Percentage Drawdown/(Date):
2.8110% (23/05/2006)

Absolute (Peak-to-Valley) Dollar Drawdown

Maximum Dollar Drawdown:
$3,394.32 (2.8110%)

Capital Peak/(Date):
$120,735.51 (17/05/2006)

Capital Valley/(Date):
$117,341.19 (23/05/2006)

Absolute (Peak-to-Valley) Percent Drawdown

Maximum Percentage Drawdown:
2.8110% ($3,394.32)

Capital Peak/(Date):
$120,735.51 (17/05/2006)

Capital Valley/(Date):
$117,341.19 (23/05/2006)
 
Actually, though UK based - I'm more interested in strategies for US markets - I think the spreads involved would kill any system that trades UK stock over such a short time frame, outside the top 100.

Totally agree. I only trade the FTSE100 and the vast majority of my trading is based and focused in the US.
 
Hello All,

Okay.... Here is a very quick update. I haven't been able to dedicate too much time to this but the initial results are very disappointing when trading the UK Mrkts using EOD.

Firstly, here is the AB code which I have used:

Cond1 = RSI(2) <2 AND C >Ref(MA(C,200),-1) ;

Buysig = Cond1;

Buy = Ref(BuySig,-1) AND L<=(ValueWhen(BuySig, Close) * 0.965);
BuyPrice = ValueWhen(BuySig, Close) * 0.965;

InitStopL = BuyPrice *0.95;

SellSig1 = L <= ValueWhen(Buy,InitStopL);
SellSig2 = Close > MA(Close, 5);

SellSig = SellSig1 OR SellSig2;


Sell = Ref(SellSig ,-1);
SellPrice = Open;


I backtested both the FTSE250 & FTSE100 over the period 01/01/98 to 31/12/04. Testing on the FTSE250 roughly produced a 10% loss to starting capital over the entire period, while the FTSE100 resulted in roughly a 10% gain.

I've gone through a number of the individual trades and the Buy, Sell & Initial Stop price values seem correct.

I'll try and investigate further & post detailed results when time allows, but in the meantime can I ask Suthers to confirm that the code logic I've posted is correct.

regards,

Chorlton


Hi Chorlton,

I had another look through your code and have found an error. Cond1 can be RSi(2)<2 and c>ma(c,200), due to the fact that your Buy refrences the signal yesterday. Also, I'm not sure whether you remember but I included an entry filter. The entry filter is: if the open today (entry day) is greater than the close yesterday then enter at yeterdays close*0.965, otherwise if the open is less than yesterdays close then enter at todays open*0.965. This helps to boost performance quite considerably. In a nutshel if the share gaps down on the open we will still demand another 3.5% drop from the open before entry.

It also looks as though you have implemented an initial stop. I only use the stop to calculate position size. Including an initial stop does hamper performace considerably.

These changes will make a positive difference in your results.

I don't use your software so forgive me if I've interpreted the code incorrectly.

Regards,

Suthers
 
Blades / Suthers,

Can I ask what Position Sizing model and associated parameter values you are using?

Fixed % risk model and I use 1%, the parameters are 2 period RSi of the close less than 2, trend filter is the simple 200 ma of clsoe, and to exit the simple 5ma of close.
 
Hi Chorlton,

I had another look through your code and have found an error. Cond1 can be RSi(2)<2 and c>ma(c,200), due to the fact that your Buy refrences the signal yesterday. Also, I'm not sure whether you remember but I included an entry filter. The entry filter is: if the open today (entry day) is greater than the close yesterday then enter at yeterdays close*0.965, otherwise if the open is less than yesterdays close then enter at todays open*0.965. This helps to boost performance quite considerably. In a nutshel if the share gaps down on the open we will still demand another 3.5% drop from the open before entry.

It also looks as though you have implemented an initial stop. I only use the stop to calculate position size. Including an initial stop does hamper performace considerably.

These changes will make a positive difference in your results.

I don't use your software so forgive me if I've interpreted the code incorrectly.

Regards,

Suthers

Hi Suthers,

You are indeed correct. I wrote the code quickly while juggling work commitments and totally forgot about the additional entry condition, which was posted separately. I will add it and backtest accordingly for completeness, although with this condition one would have to monitor the Mrkts intraday (well at the open before placing a trade) which concerns me. However, this is a separate point and not pertinent to the task at hand.

Consequently, I will update the code and post a condensed version of the results again.


Regards,
Chorlton
 
OK, something doesn't add up.

When I test this on the FTSE250 list I have, my results show a CAR of 25% and a RAR of 190% and a sharp of >3.

I've tested this up until present day - with just about all trades taking place for 2003 onwards.

There's been a big drawdown which I suspect corresponds with drops in the index - might suggest this strategy works best in a bull market and the 250 moved a lot in the upward phase of the equity curve.

Lack of trades prior to 2003 could match my lack of data during this period.

Equity attched.

Chorlon / Suthers- could you test this on more recent data - maybe 2003 to present and see if your results more match mine?

Cheers,
UTB

Hi Blades,

My tests confirm yours. In fact I studied the results from 1991 onwards and the perfomance is dismal up until literally the beginning of 2003 where the performance changes from down to up. From 2003-2007 we were in a fabulous bull market, but the market has been far from bull territory this year and the results are still really good for 2008. I've got accuracy way above 70% with PF at 3.2. Interesting.....

Cheers,

Suthers
 
Hi Blades,

My tests confirm yours. In fact I studied the results from 1991 onwards and the perfomance is dismal up until literally the beginning of 2003 where the performance changes from down to up. From 2003-2007 we were in a fabulous bull market, but the market has been far from bull territory this year and the results are still really good for 2008. I've got accuracy way above 70% with PF at 3.2. Interesting.....

Cheers,

Suthers

Ok..... Attempt #2 (Entry condition corrected and Init Stop removed).

My results now seem to be in line with yours. Prior to 2003 results are dismal. However from 2003 onwards, performance improves dramatically, which as pointed out is in line with the start of the Bull Mrkt.

Period Tested: 01/01/03 to 31/05/08

Assuming $100k Starting Capital, No pyramiding of Profits and 1% risk

Profit Factor: 4.3
Win %: 74.7%
Avg Win/Avg Loss: 1.45
Max Peak-Valley DD: 1.6%
 
Ok..... Attempt #2 (Entry condition corrected and Init Stop removed).

My results now seem to be in line with yours. Prior to 2003 results are dismal. However from 2003 onwards, performance improves dramatically, which as pointed out is in line with the start of the Bull Mrkt.

Period Tested: 01/01/03 to 31/05/08

Assuming $100k Starting Capital, No pyramiding of Profits and 1% risk

Profit Factor: 4.3
Win %: 74.7%
Avg Win/Avg Loss: 1.45
Max Peak-Valley DD: 1.6%


dumb question time - how do I limit my risk to 1% - without the use of stops? Is this a setting within the backtest function?

I have a similar win %, but a profit factor half yours and a portfolio system drawdown of about 28% - nothing like yours.

I haven't coded the limit based on the relationship between the open and yesterdays close - I will attempt to do so but doubt that would effect the drawdown so significantly.

Cheers,
UTB
 
dumb question time - how do I limit my risk to 1% - without the use of stops? Is this a setting within the backtest function?

I have a similar win %, but a profit factor half yours and a portfolio system drawdown of about 28% - nothing like yours.

I haven't coded the limit based on the relationship between the open and yesterdays close - I will attempt to do so but doubt that would effect the drawdown so significantly.

Cheers,
UTB

Hello Blades,

My Money Management and Position Sizing rules are controlled with separate software called TradeSim. In case you are not familiar with it, TradeSim is a backtesting tool which among other things enables Monte Carlo analysis to be carried out, which IMO is vital if one intends to trade a portfolio.

In my circumstances, I use AB purely to generate the Buy & Sell signals which are then exported into TradeSim to enable further testing. I'm sure something similar could probably be achieved without the use of TradeSim but as I have it, it makes sense to take full advantage of the functions that it offers.

Regards,

Chorlton
 
Hello Blades,

My Money Management and Position Sizing rules are controlled with separate software called TradeSim. In case you are not familiar with it, TradeSim is a backtesting tool which among other things enables Monte Carlo analysis to be carried out, which IMO is vital if one intends to trade a portfolio.

In my circumstances, I use AB purely to generate the Buy & Sell signals which are then exported into TradeSim to enable further testing. I'm sure something similar could probably be achieved without the use of TradeSim but as I have it, it makes sense to take full advantage of the functions that it offers.

Regards,

Chorlton



so is the 1% risk limit is based purely on the size of the account - ie a £10K account would allow 100 positions of £100 with no stop - or am I missing the point (as these would be very small positions). Maybe the 1% risk a monte carlo parameter (ie a 99% confidence belt?)

Thanks again,
UTB
 
so is the 1% risk limit is based purely on the size of the account - ie a £10K account would allow 100 positions of £100 with no stop - or am I missing the point (as these would be very small positions). Maybe the 1% risk a monte carlo parameter (ie a 99% confidence belt?)

Thanks again,
UTB

Blades,

Basically, Fixed Fractional Position Sizing is being used. You are right in the sense that 1% of the account is being risked on any one trade BUT the criteria being specified by Suthers is that the Initial Stop (which is being placed 5% away from price) is being used for Position Sizing ONLY. ie. not to exit a trade.

As an example, assume that we are purchasing a stock at £1.00. Initial Stop will be at 95p (5% below price), which equates to 5p risk. On a 10k account, 1% risk is £100. We then divide £100 / 5p which will then result in the number of shares that we can purchase. In this case 2000.

Normally, the initial stop would also be used to exit a position if price fell below it but in the case of the RSI Bounce System the only way to exit the trade is using the MA, which was my initial concern in an earlier post.

Hope this helps....

Chorlton
 
Last edited:
Blades,

Basically, Fixed Fractional Position Sizing is being used. You are right in the sense that 1% of the account is being risked on any one trade BUT the criteria being specified by Suthers is that the Initial Stop (which is being placed 5% away from price) is being used for Position Sizing ONLY. ie. not to exit a trade.

As an example, assume that we are purchasing a stock at £1.00. Initial Stop will be at 95p (5% below price), which equates to 5p risk. On a 10k account, 1% risk is £100. We then divide £100 / 5p which will then result in the number of shares that we can purchase. In this case 2000.

Normally, the initial stop would also be used to exit a position if price fell below it but in the case of the RSI Bounce System the only way to exit the trade is using the MA, which was my initial concern in an earlier post.

Hope this helps....

Chorlton


Thanks again.

Could I ask you to post up your ammended code? Yours is slightly different to mine, an I'm trying to get my head around the ref function.

Cheers,
UTB
 
Thanks again.

Could I ask you to post up your ammended code? Yours is slightly different to mine, an I'm trying to get my head around the ref function.

Cheers,
UTB

alternatively, cast an eye over mine would you? - I believe I've corrected the errors re the delay between the signal and the entry day.

Also, I've sent you a pm about a related Amibroker matter.


BuySig = Ref(C,-1)>MA((Ref(C,-1)),200)
AND Ref((RSI( 2 )),-1) < 2;


// If we can get in at 3% below the Close on the
// day of the signal or 3% less than the following open should it be less than the preceding close, we will enter
// otherwise pass on this signal.

Buy = (Ref(BuySig,-1)==1) AND (L<0.97*Ref(C,-1));
BuyPrice = IIf((O<Ref(C,-1)),0.97*O,0.97*Ref(C,-1));

Sell = Close > MA( Close , 5 );

Short = 0;

Cover = 0;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

e = Equity();

Plot(e,"Equity",colorRed,styleLine|styleOwnScale);

UTB
 
Last edited:
Thanks again.

Could I ask you to post up your ammended code? Yours is slightly different to mine, an I'm trying to get my head around the ref function.

Cheers,
UTB

Blades,

Extract Code as requested:

SetTradeDelays( 1, 1, 0, 0);

Cond1 = RSI(2) <2 AND C >MA(C,200) ;
Buysig = Cond1;
Buy = Ref(BuySig,-1) AND L<=IIf(O>ValueWhen(BuySig, Close),ValueWhen(BuySig, Close),O)*0.965;
BuyPrice = IIf(O>ValueWhen(BuySig, Close),ValueWhen(BuySig, Close),O)*0.965;


SellSig1 = Close > MA(Close, 5);;
Sell = Ref(SellSig1,-1);
SellPrice = Open;


I could have removed BuySig and simply replaced it with cond1 in this instance. However, on most occasions one would have more than 1 condition and the BuySig variable would be used to group them into one.

Regards,

Chorlton
 
OK, after correcting my code and redoing walk forward tests and monte-carlo analysis - my tests agree with Suthers that the system might have some merit.

The RAR is excellent (maybe too good) but what would put most of is a drawdown approaching 30%. Not suprisingly the system is vulnerable to bear markets.

I've coded in a simple filter that blocks trades based on the relationship between the close of the Russell and it's moving ave - to try to go with the trend of the broader market.

Drawdown has reduced to about 20%, RAR remains largely untouched although exposure (hence net returns) as halved.

1. What measures should we look at to decide if this is tradeable
2. Any suggestions for filters that might help?

UTB
 
Last edited:
Suthers, I don't know if you're still around but a few questions;

When trading this type of system you need to either place a lot of limit orders in order for a few to get hit (I suspect about 100 candidates for 5 to hit......ish). How do you get around this? Do you scan the previous days candidates, or take every trade that comes? On most days this would be manageable but on some occasions, you might get hit with the lt, rendering in impractical?

How do you manage tis type of thing? I appreciate you don't trade this outright but you've suggested this is the basis of your trading.

Cheers,
UTB
 
Hi Blades,

Still around, battling these crazy markets, Lehman Bro etc. First thing I do once I've dowloaded all my end of day data is to scan the stocks I trade for setup candidates i.e. stocks with rsi values below 2 and greater than 200ma. If there are a number of setups I would print the list in ascending order i.e. stocks with the lowest rsi values followed by those with higher values. You may use this list to discriminate trades, testing shows trades with lower rsi values to be better performers. As a risk measure I never hold more than 3 open trades at a time. This lowers drawdown and risk of ruin. Before the trade day I create a watchlist in my platform and once trading begins I look to enter my setups when they trigger the final rule i.e. drop 3.5%. Some discretion can be used here with regard to the timing and price that you'll enter. e.g. Really bad news around, whole market down, I may wait and enter at much lower prices picking up some positive slippage in the process.
Out of interest I've spent some time testing intraday data and have found some correlation between the ending P and L and the time during the day that trades are entered. It seems trades entered early in the day tend to not be as profitable as those entered later in the day. You could use this info i.e. only enter trades after 11:00am

Hope this helps.
 
Ive actually found buying when the RSI is above 70 and selling when the RSI is below 30 on a confirmed trend to have merits.
 
Top