RicardoSantos

[RS]Temporal Extrapolated Volume Rate Of Power V0

EXPERIMENTAL: method to read volume rate of power from extrapolated volume from moving price.
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
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)