fibo

Aj2020

New member
Hi, I have this code for Fibo. I want to turn it to scanner could you plese help me


input ShowLines = yes;
input ShowClouds = yes;
input ShowBubbles = yes;
input intensity = 1.7;
input bubblemover = 1;
def BM = BubbleMover + 1;
def BubbleSpot = IsNaN(close[bubbleMover]) && !IsNaN(close[bm]);
def hh = HighestAll(high);
def ll = LowestAll(low);
def dif = hh - ll;
def h1 = if BarNumber() == 1 then 0 else if high == hh then BarNumber() else h1[1];
def l1 = if BarNumber() == 1 then 0 else if low == ll then BarNumber() else l1[1];
def flip = h1 > l1;
def edgeh = if flip then ll else hh;
def edgel = if flip then hh else ll;
def begin = Min(h1, l1);
def useclouds = ShowClouds and (h1 != 0 and l1 != 0);
def uselines = ShowLines and (h1 != 0 and l1 != 0);
def fib786 = if !flip then ll + dif * 0.786 else hh - dif * 0.786;
def fib618 = if !flip then ll + dif * 0.618 else hh - dif * 0.618;
def fib500 = if !flip then ll + dif * 0.500 else hh - dif * 0.500;
def fib382 = if !flip then ll + dif * 0.382 else hh - dif * 0.382;
def fib236 = if !flip then ll + dif * 0.236 else hh - dif * 0.236;

def cc = Min(75 * intensity / 2, 254);
def cc2 = Min(125 * intensity / 2, 254);
def cc3 = Min(175 * intensity / 2, 254);

plot p1 = if uselines then edgeh else Double.NaN;
plot p2 = if uselines then fib786 else Double.NaN;
plot p3 = if uselines then fib618 else Double.NaN;
plot p4 = if uselines then fib500 else Double.NaN;
plot p5 = if uselines then fib382 else Double.NaN;
plot p6 = if uselines then fib236 else Double.NaN;
plot p7 = if uselines then edgel else Double.NaN;
p1.SetStyle(Curve.SHORT_DASH);
p2.SetStyle(Curve.SHORT_DASH);
p3.SetStyle(Curve.SHORT_DASH);
p4.SetStyle(Curve.SHORT_DASH);
p5.SetStyle(Curve.SHORT_DASH);
p6.SetStyle(Curve.SHORT_DASH);
p7.SetStyle(Curve.SHORT_DASH);
p1.SetDefaultColor(CreateColor(0, cc3, cc));
p2.SetDefaultColor(CreateColor(0, cc2, cc));
p3.SetDefaultColor(CreateColor(0, cc, cc));
p4.SetDefaultColor(CreateColor(cc, cc, cc2));
p5.SetDefaultColor(CreateColor(cc, 0, cc));
p6.SetDefaultColor(CreateColor(cc2, 0, cc));
p7.SetDefaultColor(CreateColor(cc3, 0, cc));
p1.SetLineWeight(2);
p4.SetLineWeight(2);
p7.SetLineWeight(2);




# build the candle
def o;
def h;
def l;
def c;
o = GetValue(open, -0);
h = GetValue(high, -0);
l = GetValue(low, -0);
c = GetValue(close, -0);

# just the UP candles
def UpO;
def UpH;
def UpL;
def UpC;
if o <= c
then {
UpO = o;
UpH = h;
UpL = l;
UpC = c;
} else {
UpO = Double.NaN;
UpH = Double.NaN;
UpL = Double.NaN;
UpC = Double.NaN;
}

# just the DOWN candles
def DnO;
def DnH;
def DnL;
def DnC;
if o > c
then {
DnO = o;
DnH = h;
DnL = l;
DnC = c;
} else {
DnO = Double.NaN;
DnH = Double.NaN;
DnL = Double.NaN;
DnC = Double.NaN;
}

# Plot the new Chart


#addcloud(hh, ll, createcolor(cc, cc, cc), createcolor(cc, cc, cc));
AddCloud(if useclouds then edgeh else Double.NaN, fib786, CreateColor(0, cc3, cc2), CreateColor(0, cc3, cc2));
AddCloud(if useclouds then fib786 else Double.NaN, fib618, CreateColor(0, cc2, cc2), CreateColor(0, cc2, cc2));
AddCloud(if useclouds then fib618 else Double.NaN, fib500, CreateColor(0, cc, cc), CreateColor(0, cc, cc));
AddCloud(if useclouds then fib500 else Double.NaN, fib382, CreateColor(cc, 0, cc), CreateColor(cc, 0, cc));
AddCloud(if useclouds then fib382 else Double.NaN, fib236, CreateColor(cc2, 0, cc2), CreateColor(cc2, 0, cc2));
AddCloud(if useclouds then fib236 else Double.NaN, edgel, CreateColor(cc3, 0, cc2), CreateColor(cc3, 0, cc2));

AddChartBubble(BubbleSpot and ShowBubbles, edgeh[bm] , if !flip[bm] then "FIBHigh" else "FIBLow", if !flip[bm] then CreateColor(0, cc3, cc3) else CreateColor(cc3, 0, cc3), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, Fib786[bm] , "78.6%", if !flip[bm] then CreateColor(0, cc3, cc2) else CreateColor(cc3, 0, cc2), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, Fib618[bm] , "61.8%", if !flip[bm] then CreateColor(0, cc2, cc) else CreateColor(cc2, 0, cc), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, Fib500[bm] , "50%", CreateColor(cc, cc, cc2), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, Fib382[bm] , "38.2%", if !flip[bm] then CreateColor(cc2, 0, cc) else CreateColor(0, cc2, cc), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, Fib236[bm] , "23.6%", if !flip[bm] then CreateColor(cc3, 0, cc2) else CreateColor(0, cc3, cc2), if !flip[bm] then yes else no);
AddChartBubble(BubbleSpot and ShowBubbles, edgel[bm] , if !flip[bm] then "FIBLow" else "FIBHigh", if !flip[bm] then CreateColor(cc3, 0, cc3) else CreateColor(0, cc3, cc3), if !flip[bm] then no else yes);
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

maby the pic will explain more than me

Inkedfibo-LI.jpg
 
Last edited by a moderator:

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
402 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

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?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top