# Fibonacci Bollinger Bands For ThinkOrSwim

##### Member
VIP
The author states:
These Bollinger bands feature Fibonacci retracements to very clearly show areas of support and resistance. The basis is calculate off of the Volume Weighted Moving Average. The Bands are 3 standard deviations away from the mean. 99.73% of observations should be in this range.

I found this indicator on trading view and I would like to be able to use it on thinkorswim.
@samer800 anyways you help me with this?

Last edited by a moderator:
I found this indicator on trading view and I would like to be able to use it on thinkorswim.

Code:
``````study(shorttitle="FBB", title="Fibonacci Bollinger Bands", overlay=true)
length = input(200, minval=1)
src = input(hlc3, title="Source")
mult = input(3.0, minval=0.001, maxval=50)
basis = vwma(src, length)
dev = mult * stdev(src, length)
upper_1= basis + (0.236*dev)
upper_2= basis + (0.382*dev)
upper_3= basis + (0.5*dev)
upper_4= basis + (0.618*dev)
upper_5= basis + (0.764*dev)
upper_6= basis + (1*dev)
lower_1= basis - (0.236*dev)
lower_2= basis - (0.382*dev)
lower_3= basis - (0.5*dev)
lower_4= basis - (0.618*dev)
lower_5= basis - (0.764*dev)
lower_6= basis - (1*dev)
plot(basis, color=fuchsia, linewidth=2)
p1 = plot(upper_1, color=white, linewidth=1, title="0.236")
p2 = plot(upper_2, color=white, linewidth=1, title="0.382")
p3 = plot(upper_3, color=white, linewidth=1, title="0.5")
p4 = plot(upper_4, color=white, linewidth=1, title="0.618")
p5 = plot(upper_5, color=white, linewidth=1, title="0.764")
p6 = plot(upper_6, color=red, linewidth=2, title="1")
p13 = plot(lower_1, color=white, linewidth=1, title="0.236")
p14 = plot(lower_2, color=white, linewidth=1, title="0.382")
p15 = plot(lower_3, color=white, linewidth=1, title="0.5")
p16 = plot(lower_4, color=white, linewidth=1, title="0.618")
p17 = plot(lower_5, color=white, linewidth=1, title="0.764")
p18 = plot(lower_6, color=green, linewidth=2, title="1")``````

@samer800 anyways you help me with this?
check the below:

CSS:
``````#https://www.tradingview.com/v/qIKR3tbN/
#study(shorttitle="FBB", title="Fibonacci Bollinger Bands", overlay=true)
# Converted by Sam4Cok@Samer800    - 04/2024

input src = hlc3; #, title="Source")
input length = 200; #, minval=1)
input mult = 3.0; #, minval=0.001, maxval=50)
input movAvgType = {Default VWMA, SMA, EMA, WMA, HMA, RMA};

def na = Double.NaN;
def vwma = Average(src * volume, length) / Average(volume, length);
def basis; # = ExpAverage(src, length);
Switch (movAvgType) {
Case SMA : basis = Average(src, length);
Case EMA : basis = ExpAverage(src, length);
Case WMA : basis = WMA(src, length);
Case HMA : basis = HullMovingAvg(src, length);
Case RMA : basis = WildersAverage(src, length);
Default : basis = vwma;
}

def dev = mult * stdev(src, length);
def upper_1= basis + (0.236*dev);
def upper_2= basis + (0.382*dev);
def upper_3= basis + (0.5*dev);
def upper_4= basis + (0.618*dev);
def upper_5= basis + (0.764*dev);
def upper_6= basis + (1*dev);
def lower_1= basis - (0.236*dev);
def lower_2= basis - (0.382*dev);
def lower_3= basis - (0.5*dev);
def lower_4= basis - (0.618*dev);
def lower_5= basis - (0.764*dev);
def lower_6= basis - (1*dev);

plot baseLine = basis; #, color=fuchsia, linewidth=2)
plot u236 = upper_1; # color=white, linewidth=1, title="0.236")
plot u382 = upper_2; # , color=white, linewidth=1, title="0.382")
plot u500 = upper_3; # , color=white, linewidth=1, title="0.5")
plot u618 = upper_4; # , color=white, linewidth=1, title="0.618")
plot u764 = upper_5; # , color=white, linewidth=1, title="0.764")
plot u100 = upper_6; # , color=red, linewidth=2, title="1")
plot l236 = lower_1; # , color=white, linewidth=1, title="0.236")
plot l382 = lower_2; # , color=white, linewidth=1, title="0.382")
plot l500 = lower_3; # , color=white, linewidth=1, title="0.5")
plot l618 = lower_4; # , color=white, linewidth=1, title="0.618")
plot l764 = lower_5; # , color=white, linewidth=1, title="0.764")
plot l100 = lower_6; # , color=green, linewidth=2, title="1")

baseLine.SetLineWeight(2);
u100.SetLineWeight(2);
l100.SetLineWeight(2);
baseLine.SetDefaultColor(Color.MAGENTA);

u236.SetDefaultColor(Color.DARK_GREEN);
u382.SetDefaultColor(Color.DARK_GREEN);
u500.SetDefaultColor(Color.DARK_GREEN);
u618.SetDefaultColor(Color.DARK_GREEN);
u764.SetDefaultColor(Color.DARK_GREEN);
u100.SetDefaultColor(Color.RED);
l236.SetDefaultColor(Color.DARK_RED);
l382.SetDefaultColor(Color.DARK_RED);
l500.SetDefaultColor(Color.DARK_RED);
l618.SetDefaultColor(Color.DARK_RED);
l764.SetDefaultColor(Color.DARK_RED);
l100.SetDefaultColor(Color.GREEN);

#-- END of CODE``````

check the below:

CSS:
``````#https://www.tradingview.com/v/qIKR3tbN/
#study(shorttitle="FBB", title="Fibonacci Bollinger Bands", overlay=true)
# Converted by Sam4Cok@Samer800    - 04/2024

input src = hlc3; #, title="Source")
input length = 200; #, minval=1)
input mult = 3.0; #, minval=0.001, maxval=50)
input movAvgType = {Default VWMA, SMA, EMA, WMA, HMA, RMA};

def na = Double.NaN;
def vwma = Average(src * volume, length) / Average(volume, length);
def basis; # = ExpAverage(src, length);
Switch (movAvgType) {
Case SMA : basis = Average(src, length);
Case EMA : basis = ExpAverage(src, length);
Case WMA : basis = WMA(src, length);
Case HMA : basis = HullMovingAvg(src, length);
Case RMA : basis = WildersAverage(src, length);
Default : basis = vwma;
}

def dev = mult * stdev(src, length);
def upper_1= basis + (0.236*dev);
def upper_2= basis + (0.382*dev);
def upper_3= basis + (0.5*dev);
def upper_4= basis + (0.618*dev);
def upper_5= basis + (0.764*dev);
def upper_6= basis + (1*dev);
def lower_1= basis - (0.236*dev);
def lower_2= basis - (0.382*dev);
def lower_3= basis - (0.5*dev);
def lower_4= basis - (0.618*dev);
def lower_5= basis - (0.764*dev);
def lower_6= basis - (1*dev);

plot baseLine = basis; #, color=fuchsia, linewidth=2)
plot u236 = upper_1; # color=white, linewidth=1, title="0.236")
plot u382 = upper_2; # , color=white, linewidth=1, title="0.382")
plot u500 = upper_3; # , color=white, linewidth=1, title="0.5")
plot u618 = upper_4; # , color=white, linewidth=1, title="0.618")
plot u764 = upper_5; # , color=white, linewidth=1, title="0.764")
plot u100 = upper_6; # , color=red, linewidth=2, title="1")
plot l236 = lower_1; # , color=white, linewidth=1, title="0.236")
plot l382 = lower_2; # , color=white, linewidth=1, title="0.382")
plot l500 = lower_3; # , color=white, linewidth=1, title="0.5")
plot l618 = lower_4; # , color=white, linewidth=1, title="0.618")
plot l764 = lower_5; # , color=white, linewidth=1, title="0.764")
plot l100 = lower_6; # , color=green, linewidth=2, title="1")

baseLine.SetLineWeight(2);
u100.SetLineWeight(2);
l100.SetLineWeight(2);
baseLine.SetDefaultColor(Color.MAGENTA);

u236.SetDefaultColor(Color.DARK_GREEN);
u382.SetDefaultColor(Color.DARK_GREEN);
u500.SetDefaultColor(Color.DARK_GREEN);
u618.SetDefaultColor(Color.DARK_GREEN);
u764.SetDefaultColor(Color.DARK_GREEN);
u100.SetDefaultColor(Color.RED);
l236.SetDefaultColor(Color.DARK_RED);
l382.SetDefaultColor(Color.DARK_RED);
l500.SetDefaultColor(Color.DARK_RED);
l618.SetDefaultColor(Color.DARK_RED);
l764.SetDefaultColor(Color.DARK_RED);
l100.SetDefaultColor(Color.GREEN);

#-- END of CODE``````
the pic looks like a fish

87k+ Posts
271 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?