BTC SOPR Momentum: Onchain
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MJShahsavar

//@version=5
indicator("BTC SOPR Momentum: Onchain")
R = input.symbol("BTC_SOPR", "Symbol")
src = request.security(R, 'D', close)
D = ta.sma(src, 14)
M = ta.rsi(D, 14)
h1=hline (78)
h2= hline (22)
h3= hline (55)
h4= hline (45)
h5=hline (50)
h6=hline (0)
h7=hline (100)
fill (h3, h4, color.black, transp = 60)
fill (h1, h7, color.red, transp = 60)
fill (h2, h6, color.blue, transp = 60)

plot (M, "hashColor" ,  M >= 80 ? color.blue : M <= 20 ? color.red : color.maroon,  linewidth=1)

