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

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
//@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)