RicardoSantos

[RS]Temporal Extrapolated Volume Rate Of Power V0

EXPERIMENTAL: method to read volume rate of power from extrapolated volume from moving price.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title="[RS]Temporal Extrapolated Volume Rate Of Power V0", shorttitle="[RS]TEV.ROP.V0", overlay=false)
tf = input("1")
tf_period = input(60)
use_ha = input(false)
normalize_volume = input(false)

tv = sum(high-low, tf_period)
nv = sum(close < open ? open-close : 0, tf_period)
pv = sum(close > open ? close-open : 0, tf_period)

tv_s = use_ha ? security(heikenashi(tickerid), tf, tv) : security(tickerid, tf, tv)
nv_s = use_ha ? security(heikenashi(tickerid), tf, nv) : security(tickerid, tf, nv)
pv_s = use_ha ? security(heikenashi(tickerid), tf, pv) : security(tickerid, tf, pv)

normalized_volume = normalize_volume ? sum(tv_s, 100)/100 : tv_s

bull_power = pv_s > nv_s ? (pv_s/normalized_volume)*100 : 0
bear_power = pv_s < nv_s ? (nv_s/normalized_volume)*100 : 0

reversal_alert = pv_s > nv_s ? (nv_s/normalized_volume)*100 : nv_s > pv_s ? (pv_s/normalized_volume)*100 : 0
//reversal_alert = pv_s > nv_s ? (nv_s/(tv_s-pv_s))*100 : nv_s > pv_s ? (pv_s/(tv_s-nv_s))*100 : 0
plot(reversal_alert, style=line, color=black, linewidth=2)
plot(bear_power, style=columns, color=maroon)
plot(bull_power, style=columns, color=green)

hline(0)
hline(50)
hline(100)

isBull()=>bull_power > reversal_alert
isBear()=>bear_power > reversal_alert
noResistance()=>reversal_alert <= 5
isResistanceRising()=>rising(reversal_alert, 2) and reversal_alert > 5
isResistancefalling()=>falling(reversal_alert, 2)

barColorCondition = isBull() and noResistance() ? green :
        isBull() and isResistanceRising() ? olive :
        isBear() and noResistance() ? maroon :
        isBear() and isResistanceRising() ? orange :
        bull_power > reversal_alert ? lime :
        bear_power > reversal_alert ? red : yellow
showBarColor = input(true)
barcolor(not showBarColor ? na : barColorCondition)