The ScalpTrader Relative Strength Index (RSI) indicator is a customized RSI with added functionality, notably the optional Bollinger Bands overlay.

At its core, the script calculates the RSI, which is a popular momentum indicator used in technical analysis to identify overbought and oversold conditions. It does this by taking the average gain and the average loss over a user-defined period (default is 14) to compute the relative strength, which is then transformed into the RSI.

Furthermore, this script provides the option to overlay Bollinger Bands on the RSI line. Bollinger Bands, consisting of a middle band (a moving average) with two outer bands (standard deviations of the middle band), are used to measure volatility and ‘relative’ high or low prices. When applied to the RSI, they can offer another perspective on the momentum and volatility of the market.

RSI plot values are colored green if above 50 and red if below 50 to give the trader a sense of bullish or bearish price action