The RSI Swing Indicator is an advanced analytical tool that utilizes the popular and one of my favorite indicators, the Relative Strength Index (RSI), to offer a more dynamic and versatile way to identify overbought and oversold conditions in the market. This indicator stands out for its ability to adapt to different market conditions and its utility across multiple time frames, making it a valuable choice for both intraday traders and those who prefer longer-term operations.
The RSI Swing Indicator goes beyond simply measuring price dynamics, allowing users to set personalized overbought and oversold thresholds, and offering a clear visualization of price channels and pivot points that are critical for trading decision-making. Its intuitive design and the implementation of visual signals make it easier to identify optimal moments to enter or exit the market, thus improving trading strategies based on technical indicators.
With its focus on customization and adaptability, the RSI Swing Indicator presents itself as an essential tool for traders looking to maximize their operational efficiency and continually improve their market analysis methods.
The RSI Swing Indicator is based on several input variables that traders can customize according to their specific trading needs. These variables are fundamental to adjusting the indicator to different assets and time frames.
The RSI value is calculated using the standard RSI formula, which compares the magnitude of recent gains to recent losses to measure the speed and change conditions of price movements:
rsiValue = rsi[rsiLength](rsiSource)
Where rsiSource can be any price series, such as close, open, high, or low prices, as defined by the user.
rsiValue is equal to or exceeds the overbought threshold (rsiOverbought).rsiValue is equal to or below the oversold threshold (rsiOversold).These conditions are crucial for identifying potential entry or exit points, based on the premise that the price could reverse after reaching these extreme zones.
Channels and pivot points are calculated based on whether the price is in an overbought or oversold state. The indicator plots these channels and points using codes that dynamically adjust their length and position based on market conditions and user inputs. This methodology allows traders to visualize support and resistance levels adjusted to the current market behavior, which is especially useful in volatile or trending markets.
The implementation of these channels and pivot points helps traders better visualize the market structure and make informed decisions based on clear and adaptive technical levels.
Implementing the RSI Swing Indicator on the ProRealTime platform is a process that involves properly adjusting the indicator’s settings to align with trading objectives and market characteristics. Here I provide a step-by-step guide on how to configure and use this indicator in your operations.
rsiLength, rsiOverbought, and rsiOversold according to your needs. This may vary depending on the asset and the time frame you are using.This practical approach will allow you not only to follow the standard conditions of the RSI but also to leverage a deeper and adaptive market analysis with the help of channels and pivot points.
Below is the complete code of the RSI Swing Indicator, which includes the logic to calculate and visualize the states of overbought and oversold, as well as the channels and pivot points:
//--------------------------------------------------------------//
//PRC_RSI Swing Indicator
//version = 0
//23.04.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//--------------------------------------------------------------//
//----Inputs----------------------------------------------------//
rsisource=customclose
rsiLength=7
rsioverbought=70
rsioversold=30
//--------------------------------------------------------------//
//-----RSI value------------------------------------------------//
rsivalue=rsi[rsilength](rsiSource)
//-----Current State--------------------------------------------//
isOverbought = rsiValue >= rsiOverbought
isOversold = rsiValue <= rsioversold
//--------------------------------------------------------------//
//-----High and low channel-------------------------------------//
//---Low: calculated when is not overbought
if isOverbought then
notob=0
else
notob=notob+1
pl=lowest[notob](low)
plx=barindex-barssince(pl=low)
endif
//---High: calculated when is not oversold
if isOversold then
notos=0
else
notos=notos+1
ph=highest[notos](high)
phx=barindex - barssince(ph=high)
endif
//--------------------------------------------------------------//
//-----Pivot Points (High&Low)----------------------------------//
//---Check after exit oversold state
if isoversold[1] and not isoversold then
prevlastosx=lastosx//keep the previous pivot barindex
lastosx=plx//set the new pivot barindex
//---Draw only if is the last high
if lastosx>lastobx and prevlastosx < lastobx then
lasty1=y1
x1=phx[1]
y1=ph[1]
drawpoint(x1,y1,2)coloured("red")
drawsegment(x1,y1,x2,y2)coloured("blue")style(dottedline)
if lasty1 > y1 then
drawtext("LH",x1,y1+0.5*tr)coloured("red")
else
drawtext("HH",x1,y1+0.5*tr)coloured("red")
endif
endif
endif
//---Check after exit overbought state
if isOverbought[1] and not isOverbought then
prevlastobx=lastobx//keep the previous pivot barindex
lastobx=phx//set the new pivot barindex
//---Draw only if is the last low
if lastobx>lastosx and prevlastobx < lastosx then
lasty2=y2
x2=plx[1]
y2=pl[1]
drawpoint(x2,y2,2)coloured("green")
drawsegment(x2,y2,x1,y1)coloured("blue")style(dottedline)
if lasty2 > y2 then
drawtext("LL",x2,y2-0.5*tr)coloured("green")
else
drawtext("HL",x2,y2-0.5*tr)coloured("green")
endif
endif
endif
//--------------------------------------------------------------//
//-----Draw the last segment------------------------------------//
if islastbarupdate then
if x1 > x2 then
drawsegment(x1,y1,plx,pl)coloured("blue")style(dottedline)
else
drawsegment(x2,y2,phx,ph)coloured("blue")style(dottedline)
endif
endif
//--------------------------------------------------------------//
return //pl as "Low Channel"coloured("green"), ph as "High Channel"coloured("red")
This code can be adapted or modified according to the specific needs of the user.
The RSI Swing Indicator represents a robust and adaptable technical analysis tool, capable of providing valuable insights into market dynamics. Through its clear visual signals and precise identification of overbought and oversold zones, this indicator facilitates more informed and strategically founded trading decisions.
We encourage you to experiment with this indicator, adjusting its parameters and applying it to different markets to see how it can improve your trading. Customization and continuous practice are key to maximizing the capabilities of any analytical tool in trading.