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 !!

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@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)