Rsi Ob-Os
Rsi Ob-Os
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 80)
hiddenBearColor = color.new(color.red, 80)
textColor = color.white
noneColor = color.new(color.white, 100)
_inRange(cond) =>
bars = barssince(cond == true)
rangeLower <= bars and bars <= rangeUpper
// --------- Colors
c_orange = #f57f17 //Orange
c_green = #006400 //Green
c_green50 = #00640080//Green 50%
c_red = #8B0000 //Red
c_red50 = #8B000080//Red 50%
c_gray = #808080 //Gray
// --------- Plot
p_0 = plot(
osc,
title = "RSI",
color = c_orange)
p_1 = plot(
i_oversold,
title = "Oversold",
color = c_gray)
p_2 = plot(
i_overbought,
title = "Overbought",
color = c_gray)
fill(
p_1, p_0,
color = f_osCol,
transp = 5)
fill(
p_2, p_0,
color = f_obCol,
transp = 5)
// --------- Alerts
plot(
f_osIn ? i_oversold :
f_obIn ? i_overbought : na,
title = "RSI Over In",
color = c_orange,
linewidth = 3,
style = plot.style_circles)
plot(
f_osOut ? i_oversold :
f_obOut ? i_overbought : na,
title = "RSI Over Out",
color = c_orange,
linewidth = 4,
style = plot.style_circles)
fill(
p_1, p_2,
color = c_gray,
transp = 95)
//------------------------------------------------------------------------------
// Regular Bullish
plot(
plFound ? osc[lbR] : na,
offset=-lbR,
title="Regular Bullish",
linewidth=2,
color=(bullCond ? bullColor : noneColor),
transp=0
)
plotshape(
bullCond ? osc[lbR] : na,
offset=-lbR,
title="Regular Bullish Label",
text=" Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor,
transp=0
)
//------------------------------------------------------------------------------
// Hidden Bullish
plot(
plFound ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bullish",
linewidth=2,
color=(hiddenBullCond ? hiddenBullColor : noneColor),
transp=0
)
plotshape(
hiddenBullCond ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bullish Label",
text=" H Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor,
transp=0
)
//------------------------------------------------------------------------------
// Regular Bearish
plot(
phFound ? osc[lbR] : na,
offset=-lbR,
title="Regular Bearish",
linewidth=2,
color=(bearCond ? bearColor : noneColor),
transp=0
)
plotshape(
bearCond ? osc[lbR] : na,
offset=-lbR,
title="Regular Bearish Label",
text=" Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor,
transp=0
)
//------------------------------------------------------------------------------
// Hidden Bearish
plot(
phFound ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bearish",
linewidth=2,
color=(hiddenBearCond ? hiddenBearColor : noneColor),
transp=0
)
plotshape(
hiddenBearCond ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bearish Label",
text=" H Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor,
transp=0
)