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.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//@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)