In part two of this series we are going to look into how to improve the exit. Currently the exit is using a RSI(2)>50. As for the entry we are going to look at two very different outcomes
a.) High CAR, low system quality numbers
b.) Lower CAR, high system quality numbers
RSI>82 is having the highest absolute returns. However a lot of time (=low RAR%) is spend in the market in order to gain this return. Vice versa RSI>39 is exiting fast, showing a high consistency in returns (=high Sharpe ratio), but leaving some returns behind.
Let’s use TSI to moderate the RSI exit value.
As in the previous post we will define the TSI threshold as 1.65. If the market is above 1.65 it’s in a trending environment and we want to exit the trade later than in a non trending environment. That makes sense! The best value to exit in a trending environment is above 61 while it’s recommended to exit at 39 in a non trending environment.
System quality numbers stay the same while absolute returns have improvement significantly without increasing max. draw down.
The system outlined has already pretty good risk adjusted returns and metrics. It should be possible to trade for many people as it’s end of day trading with a decent frequency of trading. You can expect about 1-2 trades a month with an average holding period of less than 5 days. Emotionally it’s easy to trade as the high %of winners and a ProfitFaktor of 3.6 indicate. Of course slippage and commission have to be deducted, but with an average trade of 1.31% that’s not an issue, especially not for index trading. The system has been tested over many years, starting from 1999. Hence it survived in a number of very different market environments. The returns are consistent over the years (no severe outliers) .
As you have seen in this post, TSI is good moderator in separating trending vs. non-trending conditions.
How to further improve this system
- Volatility hasn’t been taken into account: (delayed) entries might be better under certain volatility conditions.
- The system uses a fixed position size. You might want to look into making the position size more adaptive to current volatility.
- Intermediate oversold conditions aren’t taken into account. You might want to enter a trade earlier (=higher RSI value) when intermediate timeframe is already oversold. I like to use DVI for that purpose.
SetOption("CommissionAmount",0.00); SetBacktestMode( backtestRegular); SetOption("InitialEquity", 100000); tsi = trendstrength(); LongCond = Close>MA(Close,50) OR ROC(Close,150)>0; Setup1 = Longcond==True AND ((tsi>1.65 AND RSI(2)<18) OR (tsi<1.65 AND RSI(2)<8)); Setup2 = Longcond==False AND ((tsi>1.65 AND RSI(2)<13) OR (tsi<1.65 AND RSI(2)<2)); Buy = ((Setup1 OR setup2) AND Year() >= 1999 ) * sigScaleIn; Sell = (tsi>1.65 AND RSI(2) > 61) OR (tsi<1.65 AND RSI(2) > 39); SetPositionSize(33, spsPercentOfEquity );