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..
Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
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")