BTC - Novel RPPI Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Steversteves & Stein3d

//@version=5
indicator("BTC - RPPI Indicator", overlay=true)

// Grab data from previous daily candle
last_dclose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_on)
last_dopen = request.security(syminfo.tickerid, "D", open[1], lookahead=barmerge.lookahead_on)
last_dhigh = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
last_dlow = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)
last_dvolume = request.security(syminfo.tickerid, "D", volume[1], lookahead=barmerge.lookahead_on)

today_open = request.security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on)
today_low = request.security(syminfo.tickerid, "D", low, lookahead=barmerge.lookahead_on)
today_high = request.security(syminfo.tickerid, "D", high, lookahead=barmerge.lookahead_on)

// RPP Variables: Bull Target
o = today_open * 1.083
l = last_dlow * -0.193
lo = last_dopen * 0.127
lv = last_dvolume * 0.000000002958

// Daily bull targets plot
bull_green = color.new(color.green, 40)
h2 = (o + l + lo + lv) - 4.433
h3 = h2 + 508.88
plot(h2, "Bull Target 1", bull_green)
plot(h3, "Bull Target 2", bull_green)

// RPP Variables: Bear Target
o := today_open * 1.057
f = last_dhigh * -0.249
ldl = last_dlow * 0.172

// Daily bear targets plot
bear_red = color.new(color.red, 40)
l2 = (o + f + ldl) + 18.327
neutral_target = l2 + 660.28
l3 = l2 - 660.28
// plot(l1, "Math Bear Target 1", bear_red)
plot(neutral_target, "Neutral Target", color.yellow)
plot(l2, "Bear Target 1", bear_red)
plot(l3, "Bear Target 2", bear_red)

// Anticipated Close
h = today_high * 1.214
h2 := last_dhigh * -0.160 
o := today_open * -0.209 
l := today_low * 0.130 
closeguess = (h + h2 + o + l) + 11.888
plot(closeguess, "Anticipated Close", color.purple, style=plot.style_circles)
