# Fibonacci Bollinger Bands for ThinkorSwim

#### petergluis

##### Active member

Ruby:
``````def length = 200;
def src = hlc3;
def mult = 3.0;
def basis = Sum(volume * src, length) / Sum(volume, length);
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 LineBasis =basis;
plot p1 =upper_1;
plot p2 = upper_2;
plot p3 = upper_3;
plot p4 = upper_4;
plot p5 = upper_5;
plot p6 = upper_6;
plot p13 = lower_1;
plot p14 = lower_2;
plot p15 = lower_3;
plot p16 = lower_4;
plot p17 = lower_5;
plot p18 = lower_6;

Thanks, was looking for this.

Last edited by a moderator:

87k+ Posts
403 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?