Rrrsi
Rrrsi
// Inputs
// RSI
// Smoothing MA inputs
TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected. Determines the distance between
the SMA and the bands."
bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval = 50, step = 0.5, tooltip = TT_BB,
group = GRP, display = display.data_window)
// Smoothing MA Calculation
switch MAtype
// Smoothing MA plots
// Divergence
lookbackRight = 5
lookbackLeft = 5
rangeUpper = 60
rangeLower = 5
bearColor = color.red
bullColor = color.green
textColor = color.white
bars = ta.barssince(cond)
plFound = false
phFound = false
bullCond = false
bearCond = false
rsiLBR = rsi[lookbackRight]
if calculateDivergence
//------------------------------------------------------------------------------
// Regular Bullish
lowLBR = low[lookbackRight]
//------------------------------------------------------------------------------
// Regular Bearish
highLBR = high[lookbackRight]
plot(
offset=-lookbackRight,
title="Regular Bullish",
linewidth=2,
display = display.pane
plotshape(
offset=-lookbackRight,
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
plot(
offset=-lookbackRight,
title="Regular Bearish",
linewidth=2,
display = display.pane
plotshape(
offset=-lookbackRight,
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
// Volume
volumeAvg = ta.sma(volume, volumeLength)
// Moving Average
ta.wma(close, maLength)
// MA Crossovers
// MACD
//