hecate

Should I FOMO??

Should I FOMO?? (number of revisited candles in a timeframe)
=============================================================
idea: hecate
I fomo way too much so i have created this little indicator to show me how many times (PERCENT) a candle is revisited in a period P
with the idea that i should not panic and maybe just wait patiently for a better price.
Just set the period P to your desired timeframe, days hours, whatever and WAIT patiently because many times it does come back :D and many times !!

สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2

//Should I Panic?? (number of revisited candles in a timeframe)
//=============================================================
//idea: hecate
//I fomo way too much so i have created this little indicator to show me how many times (PERCENT) a candle is revisited in a period P
//with the idea that i should not panic and maybe just wait patiently for a better price.
//Just set the period P to your desired timeframe, days hours, whatever and WAIT patiently because many times it does come back :D and many times !!

study("Should I FOMO??",overlay=true)

c=input(close)
barsback=input(title="Barsback Period (def is num of hours in a day)",type=integer,defval=168,minval=10,maxval=600)
smoothing=input(title="Smoothing",defval=2,minval=2,maxval=50)

zs(a,b)=>(a-linreg(a,b,0))/stdev(a,b)

revisit(a,b,p)=>
    tot=0
    for i = 0 to p-1
        if(cross(a,b[i]))
            tot:=tot+1
    return = tot

r=linreg(100*revisit(c,c,barsback)/barsback,smoothing,0)
md=linreg(r,600,0)
rv=(r>=md*1.5) ? 3  : (r>=md*0.5) and (r<md*1.5) ? 2 : (r<md*0.5) ? 1 : 1

col1=red
col2=yellow
col3=green

plot(close,style=line,color=rv==1?col1:rv==3?col3:rv==2?col2:na,linewidth=2,transp=0)