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)