FIBO afl

singhboy

Active Member
#12
Let me clear that stock prices moves on Taking HI LOw of last 4 days,n not current day. And For longs, if price on 5th day is near 4 days high and majority or traders feel that Low of last 4th day is too low to b retested now then they shift to 3 days or 2 days n take low of last 3 or 2 days
 

shanki99

Well-Known Member
#13
Here is the AFL which calculates FIBO points automatically based on data of yday and today

Courtesy:- Thanx to KAKA of IT

_SECTION_BEGIN("ABI");
YH=TimeFrameGetPrice("H", inDaily, -1);
YL=TimeFrameGetPrice("L", inDaily, -1);

Yo=TimeFrameGetPrice("o", inDaily, -1);
Yc=TimeFrameGetPrice("c", inDaily, -1);

TH=TimeFrameGetPrice("H", inDaily, 0);
TL=TimeFrameGetPrice("L", inDaily, 0);

Line0=YL;
Line100=YH;

Line1 = Line0 + abs(Line100-Line0)*0.236;
Line2 = Line0 + abs(Line100-Line0)*0.382;
Line3 = Line0 + abs(Line100-Line0)*0.5;
Line4 = Line0 + abs(Line100-Line0)*0.618;
Line4a = Line0 + abs(Line100-Line0)*0.786;

Line5 = Line0 + abs(Line100-Line0)*1.272;
Line6 = Line0 + abs(Line100-Line0)*1.618;
Line6a = Line0 + abs(Line100-Line0)*1.764;
Line7 = Line0 + abs(Line100-Line0)*2.000;
Line7a = Line0 + abs(Line100-Line0)*2.330;
Line8 = Line0 + abs(Line100-Line0)*2.618;
Line9 = Line0 + abs(Line100-Line0)*4.236;

Line10 = Line100 - abs(Line100-Line0)*1.272;
Line11 = Line100 - abs(Line100-Line0)*1.618;
Line11a = Line100 - abs(Line100-Line0)*1.764;
Line12 = Line100 - abs(Line100-Line0)*2.00;
Line12a = Line100 - abs(Line100-Line0)*2.330;
Line13 = Line100 - abs(Line100-Line0)*2.618;
Line14 = Line100 - abs(Line100-Line0)*4.236;

TLine0=tL;
TLine100=tH;

TLine1 = Tline0 + abs(Tline100-TLine0)*0.236; Tline1z=LastValue(Tline1,1);
Tline2 = Tline0 + abs(Tline100-Tline0)*0.382; Tline2z=LastValue(Tline2,1);
Tline3 = Tline0 + abs(Tline100-Tline0)*0.500; Tline3z=LastValue(Tline3,1);
Tline4 = Tline0 + abs(Tline100-Tline0)*0.618; Tline4z=LastValue(Tline4,1);
TLine4a = TLine0 + abs(TLine100-TLine0)*0.786; Tline4az=LastValue(Tline4a,1);

Tline5 = Tline0 + abs(Tline100-Tline0)*1.272; Tline5z=LastValue(Tline5,1);
Tline6 = Tline0 + abs(Tline100-Tline0)*1.618; Tline6z=LastValue(Tline6,1);
Tline6a = Tline0 + abs(Tline100-Tline0)*1.764; Tline6az=LastValue(Tline6a,1);
Tline7 = Tline0 + abs(Tline100-Tline0)*2.000; Tline7z=LastValue(Tline7,1);
Tline7a = Tline0 + abs(Tline100-Tline0)*2.33; Tline7az=LastValue(Tline7a,1);
Tline8 = Tline0 + abs(Tline100-Tline0)*2.618; Tline8z=LastValue(Tline8,1);
Tline9 = Tline0 + abs(Tline100-Tline0)*4.236; Tline9z=LastValue(Tline9,1);

Tline10 = Tline100 - abs(Tline100-Tline0)*1.272; Tline10z=LastValue(Tline10,1);
Tline11 = Tline100 - abs(Tline100-Tline0)*1.618; Tline11z=LastValue(Tline11,1);
Tline11a = Tline100 - abs(Tline100-Tline0)*1.786; Tline11az=LastValue(Tline11a,1);
Tline12 = Tline100 - abs(Tline100-Tline0)*2.000; Tline12z=LastValue(Tline12,1);
Tline12a = Tline100 - abs(Tline100-Tline0)*2.33; Tline12az=LastValue(Tline12a,1);
Tline13 = Tline100 - abs(Tline100-Tline0)*2.618; Tline13z=LastValue(Tline13,1);
Tline14 = Tline100 - abs(Tline100-Tline0)*4.236; Tline14z=LastValue(Tline14,1);



Plot(C,"Price",IIf(C>O,colorGreen,colorRed),styleCandle);


Plot(TH,"",colorPink,styleLine);
Plot(TL,"",colorPink,styleLine);


Plot(IIf(TimeNum()<=100000,Line1,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line2,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line3,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line4,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line4a,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line5,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line6,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line6a,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line7,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line7a,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line8,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line9,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line10,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line11,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line11a,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line12,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line12a,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line13,Null),"",colorOrange,styleDots|styleNoRescale);
Plot(IIf(TimeNum()<=100000,Line14,Null),"",colorOrange,styleDots|styleNoRescale);

// PlotText(" 23.6% ", LastValue(BarIndex())-1, L1T, colorViolet);


Plot(IIf(TimeNum()>=100000,tLine1,Null),"",colorOrange,styleBar|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine2,Null),"",colorOrange,styleBar|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine3,Null),"",colorOrange,styleBar|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine4,Null),"",colorOrange,styleBar|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine4a,Null),"",colorOrange,styleBar|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine5,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine6,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine6a,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine7,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine7a,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine8,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine9,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine10,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine11,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine11a,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine12,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine12a,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine13,Null),"",colorOrange,styleLine|styleNoRescale);
Plot(IIf(TimeNum()>=100000,tLine14,Null),"",colorOrange,styleLine|styleNoRescale);

PlotText("23.6%", LastValue(BarIndex())+1, Tline1z, colorOrange);
PlotText("38.2%", LastValue(BarIndex())+1, Tline2z, colorOrange);
PlotText("50%", LastValue(BarIndex())+1, Tline3z, colorOrange);
PlotText("61.8%", LastValue(BarIndex())+1, Tline4z, colorOrange);
PlotText("78.6%", LastValue(BarIndex())+1, Tline4az, colorOrange);
PlotText("127%", LastValue(BarIndex())+1, Tline5z, colorOrange);
PlotText("161%", LastValue(BarIndex())+1, Tline6z, colorOrange);
PlotText("176%", LastValue(BarIndex())+1, Tline6az, colorOrange);
PlotText("200%", LastValue(BarIndex())+1, Tline7z, colorOrange);
PlotText("233%", LastValue(BarIndex())+1, Tline7az, colorOrange);
PlotText("261%", LastValue(BarIndex())+1, Tline8z, colorOrange);
PlotText("423%", LastValue(BarIndex())+1, Tline9z, colorOrange);
PlotText("127%", LastValue(BarIndex())+1, Tline10z, colorOrange);
PlotText("161%", LastValue(BarIndex())+1, Tline11z, colorOrange);
PlotText("178%", LastValue(BarIndex())+1, Tline11az, colorOrange);
PlotText("200%", LastValue(BarIndex())+1, Tline12z, colorOrange);
PlotText("233%", LastValue(BarIndex())+1, Tline12az, colorOrange);
PlotText("261%", LastValue(BarIndex())+1, Tline13z, colorOrange);
PlotText("423%", LastValue(BarIndex())+1, Tline14z, colorOrange);

_SECTION_END();
 
#14
Hello,

In Amibroker when I edit Fibo color and unmark certain percentage level. It works until it is not deleted, if a Fibo is selected again from menu, it rolls back to default.

Could someone please help me with the AFL, which just has 0%-50%-100% with values next to it. Not neccessarily a Fibo (But function like it) but a sort of measuring tool, which can be streched from one price to another with above %age levels?
And how could I place it in the Menu bar for quick selection?
 

Similar threads