RicardoSantos

[RS]Temporal Extrapolated Volume V1

EXPERIMENTAL: method to extrapolate volume from moving price.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
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)