InvestitoreComune

Bollinger Bands Fibonacci ratios

The Fibonacci Bollinger Bands indicator is based on the same principles as the standard Bollinger Bands indicator developed by John Bollinger. The Fibonacci Bollinger Bands indicator bases its upper and lower bands on volatility just like the Bollinger Bands indicator does, but instead of using standard deviation as the measure of volatility, a Wilders Smoothed ATR is used in its place.

The middle band is a moving average used to establish the intermediate-term trend. The 3 upper bands are constructed by using the Wilders Smoothed ATR and multiplying it by each of the Fibonacci factors (1.618, 2.618, and 4.236) and then adding the results to the middle band. The 3 lower bands are constructed in the same manner as the upper bands except their results are subtracted from the middle band.
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
study("Bollingers Bands Fibonacci ratios",shorttitle="FiBB",overlay=true)
len=input(defval=20,minval=1)
p=close
sma=sma(p,len)
avg=atr(len)
fibratio1=input(defval=1.618,title="Fibonacci Ratio 1")
fibratio2=input(defval=2.618,title="Fibonacci Ratio 2")
fibratio3=input(defval=4.236,title="Fibonacci Ratio 3")
r1=avg*fibratio1
r2=avg*fibratio2
r3=avg*fibratio3
top3=sma+r3
top2=sma+r2
top1=sma+r1
bott1=sma-r1
bott2=sma-r2
bott3=sma-r3

t3=plot(top3,transp=0,title="Upper 3",color=teal)
t2=plot(top2,transp=20,title="Upper 2",color=teal)
t1=plot(top1,transp=40,title="Upper 1",color=teal)
b1=plot(bott1,transp=40,title="Lower 1",color=teal)
b2=plot(bott2,transp=20,title="Lower 2",color=teal)
b3=plot(bott3,transp=0,title="Lower 3",color=teal)
plot(sma,style=cross,title="SMA",color=teal)
fill(t3,b3,color=navy,transp=85)