petergluis
Active member
Shows Fibonacci waves for a long range and Fibonacci lines for a short range.
https://www.tradingview.com/script/jRQoSvBB-FIBI/
https://www.tradingview.com/script/jRQoSvBB-FIBI/
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));
addcloud (line_fibss, line_fibsssssss, color.light_red);
addcloud (line_fibssssss, line_afibsss, color.light_green);