# FIBI for ThinkorSwim

#### petergluis

##### Active member
Shows Fibonacci waves for a long range and Fibonacci lines for a short range.

Ruby:
``````def range_long = 200;
def range_short = 100;
def fibs = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 61.80);
def fibss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 11.40);
def fibsss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 78.60);
def fibssss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 38.20);
def fibsssss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 50);
def fibssssss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 100);
def fibsssssss = lowest(open, range_long) + (((highest(close, range_long) - lowest(open, range_long)) / 100) * 0);
def afibs = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 61.80);
def afibss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 11.40);
def afibsss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 78.60);
def afibssss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 38.20);
def afibsssss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 50);
def afibssssss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 100);
def afibsssssss = lowest(open, range_short) + (((highest(close, range_short) - lowest(open, range_short)) / 100) * 0);
plot line_fibssssss = fibssssss;
line_fibssssss.SetDefaultColor(GetColor(7));
plot line_afibssssss = afibssssss;
line_afibssssss.SetDefaultColor(GetColor(7));
plot line_fibsss = fibsss;
line_fibsss.SetDefaultColor(GetColor(1));
plot line_afibsss = afibsss;
line_afibsss.SetDefaultColor(GetColor(1));
plot line_fibs = fibs;
line_fibs.SetDefaultColor(GetColor(6));
plot line_afibs = afibs;
line_afibs.SetDefaultColor(GetColor(6));
plot line_fibsssss = fibsssss;
line_fibsssss.SetDefaultColor(GetColor(3));
plot line_afibsssss = afibsssss;
line_afibsssss.SetDefaultColor(GetColor(3));
plot line_fibssss =fibssss;
line_fibssss.SetDefaultColor(GetColor(9));
plot line_afibssss = afibssss;
line_afibssss.SetDefaultColor(GetColor(9));
plot line_fibss = fibss;
line_fibss.SetDefaultColor(GetColor(4));
plot line_afibss = afibss;
line_afibss.SetDefaultColor(GetColor(4));
plot line_fibsssssss = fibsssssss;
line_fibsssssss.SetDefaultColor(GetColor(5));
plot line_afibsssssss = afibsssssss;
line_afibsssssss.SetDefaultColor(GetColor(5));

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?