0% found this document useful (0 votes)
347 views1 page

RSI Bands (LazyBear)

This document contains the code for a TradingView study that plots RSI bands. It defines inputs for overbought, oversold, and RSI length levels. It then calculates upper and lower band lines using exponential moving averages of gains and losses relative to the overbought and oversold levels. The bands, midline, and RSI values are plotted on the chart.

Uploaded by

Matías
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
347 views1 page

RSI Bands (LazyBear)

This document contains the code for a TradingView study that plots RSI bands. It defines inputs for overbought, oversold, and RSI length levels. It then calculates upper and lower band lines using exponential moving averages of gains and losses relative to the overbought and oversold levels. The bands, midline, and RSI values are plotted on the chart.

Uploaded by

Matías
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

//

// @author LazyBear

// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/

//

study("RSI Bands [LazyBear]", shorttitle="RSIBANDS_LB", overlay=true)

obLevel = input(70, title="RSI Overbought")

osLevel = input(30, title="RSI Oversold")

length = input(14, title="RSI Length")

src=close

ep = 2 * length - 1

auc = ema( max( src - src[1], 0 ), ep )

adc = ema( max( src[1] - src, 0 ), ep )

x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)

ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )

x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)

lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )

plot( ub, title="Resistance", color=red, linewidth=2)

plot( lb, title="Support", color=green, linewidth=2)

plot( avg(ub, lb), title="RSI Midline", color=gray, linewidth=1)

You might also like