QuantitativeExhaustion

[RS][JR]RSI Price Bands

RSI Price Bands
By Ricardo Santos and JR

Have you ever wondered what RSI would look like as a Band? Well here it is. First premier Trading View special, RSI Price Band. Red shows overbought and Green shows oversold. You can also adjust what levels you prefer for overbought and oversold, and what additional RSI lengths you would like to see displayed on the chart..
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
study("[RS][JR]RSI Price Bands", overlay=true)

//  ||--------------------------------------------------------------------------------------------------------------------------||
//  ||---   INPUTS:     --------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------||
src = input(defval=hlc3, type=source, title="Source Series to be Used:")

showRSI1 = input(defval=true, type=bool, title="Show RSI Line 1?")
showRSI2 = input(defval=true, type=bool, title="Show RSI Line 2?")
showRSI3 = input(defval=true, type=bool, title="Show RSI Line 3?")

baseMA_length = input(defval=100, type=integer, minval=1, title="Bands Smoothness Period Length:")

fast_rsi_length = input(defval=7, type=integer, minval=1, title="Fast RSI Period Length:")
fast_smooth_length = input(defval=1, type=integer, minval=1, title="Fast RSI Smoothness Length:")
medium_rsi_length = input(defval=21, type=integer, minval=1, title="Medium RSI Period Length:")
medium_smooth_length = input(defval=1, type=integer, minval=1, title="Medium RSI Smoothness Length:")
slow_rsi_length = input(defval=50, type=integer, minval=1, title="Slow RSI Period Length:")
slow_smooth_length = input(defval=1, type=integer, minval=1, title="Slow RSI Smoothness Length:")

deviation_length = input(defval=2, type=integer, minval=1, title="Bands Tightness Period Length:")

showOBSFill = input(defval=true, type=bool, title="Show Over Bought/Sold Bands?")

//  ||--------------------------------------------------------------------------------------------------------------------------||
hh = highest(baseMA_length)
ll = lowest(baseMA_length)
//  ||--------------------------------------------------------------------------------------------------------------------------||
//  ||---   RSI to Price level conversion:     ---------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------||

baseMA = ema(avg(hh,ll), 10)//ema(src, baseMA_length)

capdev = cum(stdev(src, deviation_length)) / (n+1)

fastRSI = not showRSI1 ? na : ema(rsi(src, fast_rsi_length), fast_smooth_length)
mediumRSI = not showRSI2 ? na : ema(rsi(src, medium_rsi_length), medium_smooth_length)
slowRSI = not showRSI3 ? na : ema(rsi(src, slow_rsi_length), slow_smooth_length)

fastRSILine = not showRSI1 ? na : baseMA - (capdev*(50-fastRSI))
mediumRSILine = not showRSI2 ? na : baseMA - (capdev*(50-mediumRSI))
slowRSILine = not showRSI3 ? na : baseMA - (capdev*(50-slowRSI))

bl = plot(baseMA, color=black, title="Middle Line / RSI.50")

plot(not showRSI1 ? na : fastRSILine, color=blue, title="Fast RSI")
plot(not showRSI2 ? na : mediumRSILine, color=gray, title="Medium RSI")
plot(not showRSI3 ? na : slowRSILine, color=teal, title="Slow RSI")

//  ||--------------------------------------------------------------------------------------------------------------------------||
//  ||---   Over Bought/Sold Bands:     ----------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------||

OBLine = baseMA + (capdev*input(20))
OSLine = baseMA - (capdev*input(20))


ob1 = plot(not showOBSFill ? na : OBLine, color=black, style=circles, title="Over Bought Line")
os1 = plot(not showOBSFill ? na : OSLine, color=black, style=circles, title="Over Sold Line")

ob2 = plot(not showOBSFill ? na : baseMA + (capdev*50), color=black, style=circles, title="RSI.100 Line")
os2 = plot(not showOBSFill ? na : baseMA - (capdev*50), color=black, style=circles, title="RSI.0 Line")

fill(ob1, ob2, color=maroon, transp=90, title="Over Bought Fill")
fill(os1, os2, color=green, transp=90, title="Over Sold Fill")