RSI with EMA Strategy
In my 39 years of actual technical research experience, I have tested many of the analytical tools available. (Okay, so in my early years, I was testing different kinds of graph paper, rulers, and pencils). More than 22 years ago, I reviewed more than a dozen technical analysis software programs for PC Magazine, Special Issue, April 15, 1986, Volume 5, Number 7. MetaStock was new then, practically a startup, but it stood out above the rest, and so I selected it as “Editors’ Choice”. 17 years later, I selected MetaStock software again for exclusive use researching for my 820-page book, The Encyclopedia of Technical Market Indicators, Second Edition, McGraw-Hill Publishing, 2003. I selected MetaStock for its wide-range of powerful capabilities, its flexibility, its ease of use, and its affordability.
While doing research for my book, I ran hundreds of optimizations, back tests, and forward tests. Since then, I since have run thousands more. It is my impression that these very powerful tools are widely misunderstood and underutilized by the great majority of investors and traders. In 2005, I gave an interview to TradingMarkets.com where I demonstrated an optimized version of a robust and very popular technical indicator, RSI 3 (buy below 30, sell above 70), combined with a long-term EMA filter of 330 days, for a simple mechanical trading system that offers moderately good performance with no subjective judgment. RSI alone is a relatively weak performer, but the addition of an EMA to filter the trades is the key to greater consistency of results. Which EMA? Optimize over past actual history to find out. The full MetaStock code is shown below. The chart shows the forward tested, real-time simulated performance of this same system applied to the S&P 500 continuous futures contract since January 3, 2007. Since the Buy Long signal on January 3, 2007, this RSI/EMA system is up 8.60%, significantly outperforming Buy & Hold (which is down 12.00%) by 2060 basis points. Of 24 signals, 66.67% were profitable, with 16 winners and 8 losers. See chart for the Cumulative Equity graphed against the raw closing price data.
The purpose of this demonstration is not to recommend any specific trading system. RSI, though very popular, is not the best indicator, and it certainly is possible to develop much better trading systems than the one shown in this example. My purpose is to show that by using powerful analytical software, such as MetaStock, combining common known indicators, optimizing parameters, back testing, and forward testing, it is possible to develop a trading system that can outperform going forward. More power to you!
RSI/EMA System Code
Enter long:
(RSI(C,opt1)<50-opt2
AND
C>Ref(Mov(C,opt3,E),-1))
AND Year()>2006
Close long:
(RSI(C,opt1)>50+opt2
OR
C<Ref(Mov(C,opt3,E),-1))
AND Year()>2006
Enter short:
(RSI(C,opt1)>50+opt2
AND
C<Ref(Mov(C,opt3,E),-1))
AND Year()>2006
Close short:
(RSI(C,opt1)<50-opt2
OR
C>Ref(Mov(C,opt3,E),-1))
AND Year()>2006
OPT1
Range: From 3 to 3 by 1
Current value: 3
OPT2
Range: From 20 to 20 by 1
Current value: 20
OPT3
Range: From 330 to 330 by 1
Current value: 330
Initial equity - 1424.8
Positions - Long and short
Entry trade price - Close
Entry trade delay - 0
Exit trade price - Close
Exit trade delay - 0
Entry commission - 0%
Exit commission - 0%
Interest rate - 0%
Margin req. - 100%
Contributed by Robert W. Colby, CMT