RicardoSantos

[RS]Vector Flow Channel V1

small update: added ability to setup stage 2 length period.
开源脚本

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

免责声明

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

想在图表上使用此脚本?
study(title="[RS]Vector Flow Channel V1", shorttitle="[RS]VFC.V1", overlay=true)
decay = atr(10)*0.005
stage1 = input(5)
stage2 = input(10)
stage3 = input(20)
stage1length = input(100)
stage2length = stage1length + input(100)
pretopvector01 = nz(topvector01[1], close)
topvector01 = close >= pretopvector01 ? close : pretopvector01 - (decay * topvector01finalcounter[1])
topvector01counter = n - valuewhen(close >= topvector01, n, 0)
topvector01finalcounter = topvector01counter <= stage1length ? stage1 : topvector01counter <= stage2length ? stage2 : stage3

prebotvector01 = nz(botvector01[1], close)
botvector01 = close <= prebotvector01 ? close : prebotvector01 + (decay * botvector01finalcounter[1])
botvector01counter = n - valuewhen(close <= botvector01, n, 0)
botvector01finalcounter = botvector01counter <= stage1length ? stage1 : botvector01counter <= stage2length ? stage2 : stage3

pt = plot(topvector01, color=(topvector01 == close ? na : black))
pb = plot(botvector01, color=(botvector01 == close ? na : black))
fill(pt, pb, color=blue, transp=90)