High Probability Fibo Zone Amibroker Formula

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

_SECTION_BEGIN("FIBONACCI HIGH PROBABILITY ZONES");

ShowFibHiProbZone=ParamToggle("Show FIb High-Probability Zone","No|Yes",1);


HpzColor = ParamColor("Line Color",colorgold);
Periodicity = inDaily;

if(ShowFibHiProbZone AND Interval()<inHourly)


{
Periodicity = inDaily;
}
else if(ShowFibHiProbZone AND Interval()==inHourly)
{
Periodicity = inWeekly;
}
else if (ShowFibHiProbZone AND Interval()>=inDaily AND Interval()<inMonthly)
{
Periodicity = inMonthly;
}
else if(ShowFibHiProbZone AND Interval()>inWeekly AND Interval()<inYearly)
{
Periodicity = inYearly;
}
else // Default just to silence the compiler. This will never occur.
{
Hi=Ref(H,-1);
Lo=Ref(L,-1);
Cl=Ref(C,-1);
}

Hi=TimeFrameGetPrice("H",Periodicity,-1);
Lo=TimeFrameGetPrice("L",Periodicity ,-1);
Cl=TimeFrameGetPrice("C",Periodicity ,-1);

p=(Hi+Lo+Cl)/3;
r1=p+((Hi-Lo)/2);
s1=p-((Hi-Lo)/2);
r2=p+(Hi-Lo);
s2=p-(Hi-Lo);

//Bands
s1b=((Hi-Lo)*0.618)-p;
s2b=((Hi-Lo)*1.382)-p;

r1b=((Hi-Lo)*0.618)+p;
r2b=((Hi-Lo)*1.382)+p;

extnd=0;
sty=styleNoLabel|styleStaircase|styleline|styleNoRescale;
Plot(r1-extnd,"",HpzColor ,sty,Null,Null,extnd,1000);
//PlotOHLC(r1,r1,r1b,r1b,"",Col,sty|styleClipMinMax|styleCloud|
styleNoLine,Null,Null,extnd,1000);

Plot(s1-extnd,"",HpzColor ,sty,Null,Null,extnd,1000);
//PlotOHLC(s1,s1b,s1,s1b,"",Col,sty|styleClipMinMax|styleCloud|
styleNoLine,Null,Null,extnd,1000);
Plot(p-extnd,"",HpzColor ,styleNoLabel|styleStaircase|styleDashed|
styleNoRescale,Null,Null,extnd,1000);
Plot(r2-extnd,"",HpzColor ,sty,Null,Null,extnd,1000);
Plot(s2-extnd,"",HpzColor ,sty,Null,Null,extnd,1000);

//Daily Range Hi Lo
//Plot(Hi-extnd,"",ColorBlend(colorLime,colorBrightGreen) ,styleNoLabel|
styleStaircase|styleNoRescale,Null,Null,extnd,1000);
//Plot(Lo-extnd,"",ColorBlend(colorCustom12,colorRed) ,styleNoLabel|styleStaircase|
styleNoRescale,Null,Null,extnd,1000);

_SECTION_END();

You might also like