From Extreme to Extreme — An RSI Short-term Technique
Trading the RSI Using the Direct Reversal Technique
The direct reversal strategy is based on the short-term RSI for quick moves following a huge move. This article discusses the direct reversal technique and shows how to code the signals in TradingView.
For the complete collection of candlestick patterns in detail with back-tests and technical strategies, you can check out my newest book with O’Reilly Media. The book features a huge number of classic and modern candlestick patterns as it dwelves into the realm of technical analysis with different trading strategies. The book comes with its own GitHub and is dynamic in nature as it is continuously updated and questions are answered on the O’Reilly platform promptly.
Mastering Financial Pattern Recognition
Amazon.com: Mastering Financial Pattern Recognition eBook : Kaabar, Sofien: Kindle Storeamzn.to
Understanding the RSI
The relative strength index (RSI) is one of the most important technical indicators. It is generally good during ranging periods as it is bounded between 0 and 100.
The RSI is calculated using a rather simple way. We first start by taking price differences of one period. This means that we have to subtract every closing price from the one before it. Then, we will calculate the smoothed average of the positive differences and divide it by the smoothed average of the negative differences. The last calculation gives us the Relative Strength which is then used in the RSI formula to be transformed into a measure between 0 and 100.
The Relative Strength Index is known for the extremes strategy (Oversold and Overbought levels) where we initiate contrarian positions when the RSI is close to the extremes in an attempt to fade the current trend.
The next chart shows an example of the RSI.
Coding the Strategy in TradingView
Keeping in mind the extremes strategy which is based on the concept of oversold and overhought levels, the direct reversal strategy takes into account violent flips where a reading from the oversold zone goes directly into the overbought zone and vice versa.
This is a way of measuring the strength of the last move relative to normality. The idea is to say that the current extreme overthrew the previous extreme and that we now have to correct it. The trading rules are:
A buy (long) signal is generated whenever the 2-period RSI goes below 20 while the previous reading is above 80.
A sell (short) signal is generated whenever the 2-period RSI goes above 80 while the previous reading is below 20.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar
//@version=5
indicator("Direct Reversal Strategy", overlay = true)
// Defining the RSI
rsi = ta.rsi(close, 2)
// Signals
buy_signal = rsi < 20 and rsi[1] > 80
sell_signal = rsi > 80 and rsi[1] < 20
// Plotting
plotshape(buy_signal, style = shape.triangleup, color = color.green, location = location.belowbar, size = size.small)
plotshape(sell_signal, style = shape.triangledown, color = color.red, location = location.abovebar, size = size.small)
The following Figure shows a signal chart.
The following Figure shows another signal chart.