RicardoSantos

[RS]Temporal Extrapolated Volume V1

EXPERIMENTAL: method to extrapolate 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 V1", shorttitle="[RS]TEV.V1", overlay=false)
useAltTF = input(false)
AltTF = input("1")
tf =
    useAltTF ? AltTF : 
        period == "1" ? "1" :
        period == "5" ? "1" :
        period == "15" ? "1" :
        period == "30" ? "1" :
        period == "60" ? "1" :
        period == "240" ? "1" :
        period == "D" ? "5" :
        period == "W" ? "D" :
        period == "M" ? "D" : AltTF
AltPeriod = input(60)
tf_period =
    useAltTF ? AltPeriod :
        period == "1" ? 15 :
        period == "5" ? 30 :
        period == "15" ? 60 :
        period == "30" ? 240 :
        period == "60" ? 720 :
        period == "240" ? 1440 :
        period == "D" ? 1440 :
        period == "W" ? 30 :
        period == "M" ? 96 : AltPeriod

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

plot(normalized_volume, style=histogram, color=black)
plot(nv_s, style=columns, color=maroon)
plot(pv_s, style=columns, color=green)