FIBO afl

shanki99

Well-Known Member
#1
First, my heartfelt thanx to all those who tirelessly help others in this forum

Can someone post AFL for calculating Fibo levels automatically based on yesterday's High and low....iam really tired of doing this exercise daily, that too on many scrips....

--Lines are to extend till one hour on the next day
--Fibo projections are to be drawn on both the sides, beyond 0% as well as 100%
--In-between 0 and 100%, lines can be in dots
--Fibo projection lines can be simple lines
--Fibo projections can be 127.2, 161.8, 200, 261.8, 423.6 etc
--After 1 hour, (from 10am), Another Fibo line (dynamic) has to be drawn based on today's High and Low, with fibo projections on both sides (upper and lower)
--Todays and Yesterdays lines can be in different colour

For those who dont use Fibo.....try to use Fibo lines based on ydays high and low and u will be amazed





Thanx again
 

singhboy

Active Member
#3
/*---------------------------------------------------
Automatic Fib Levels
Aron Pipa, December, 11, 2005
modified by jan,11,2010
--------------------------------------------------------*/

GraphXSpace=2;
Plot(C,"", colorWhite,styleCandle);

// Get values for fib levels

StartBar=SelectedValue(BarIndex());
FinishBar = EndValue( BarIndex() );
i = startbar;
period = FinishBar - StartBar;

Lo =LLV(L,4);
Hi = HHV(H,4);
Line0 = 0;
Line1 = 0;
Line2 = 0;
Line3 = 0;
Line4 = 0;
Line5 = 0;
Line6 = 0;
Line7 = 0;
Line8 = 0;
Line9 = 0;
Line10 = 0;
Line11 = 0;
Line12 = 0;
Line13 = 0;
Line14 = 0;
Line15 = 0;
Line16 = 0;
Line17 = 0;
Line18 = 0;
Line100 = 0;

for( i = startbar; i < finishbar; i++ )
{
if(EndValue(C)<SelectedValue(C))
{
Line0 = EndValue(Lo);
Line100 = EndValue(Hi);
Line1 = Line0 + abs(Line100-Line0)*0.0;
Line2 = Line0 + abs(Line100-Line0)*0.145;
Line3 = Line0 + abs(Line100-Line0)*0.236;
Line4 = Line0 + abs(Line100-Line0)*0.382;
Line5 = Line0 + abs(Line100-Line0)*0.500;
Line6 = Line0 + abs(Line100-Line0)*0.618;
Line7 = Line0 + abs(Line100-Line0)*0.764;
Line8 = Line0 + abs(Line100-Line0)*0.855;
Line9 = Line0 + abs(Line100-Line0)*1.00;
Line10 = Line0 + abs(Line100-Line0)*1.145;
Line11 = Line0 + abs(Line100-Line0)*1.236;
Line12 = Line0 + abs(Line100-Line0)*1.382;
Line13 = Line0 + abs(Line100-Line0)*1.500;
Line14 = Line0 + abs(Line100-Line0)*1.618;
Line15 = Line0 + abs(Line100-Line0)*1.764;
Line16 = Line0 + abs(Line100-Line0)*1.855;
Line17 = Line0 + abs(Line100-Line0)*2.00;

}
else
{
Line100 = EndValue(Lo);
Line0 = EndValue(Hi);
Line1 = Line0 - abs(Line100-Line0)*0.0;
Line2 = Line0 - abs(Line100-Line0)*0.145;
Line3 = Line0 - abs(Line100-Line0)*0.236;
Line4 = Line0 - abs(Line100-Line0)*0.382;
Line5 = Line0 - abs(Line100-Line0)*0.500;
Line6 = Line0 - abs(Line100-Line0)*0.618;
Line7 = Line0 - abs(Line100-Line0)*0.764;
Line8 = Line0 - abs(Line100-Line0)*0.855;
Line9 = Line0 - abs(Line100-Line0)*1.00;
Line10 = Line0 - abs(Line100-Line0)*1.145;
Line11 = Line0 - abs(Line100-Line0)*1.236;
Line12 = Line0 - abs(Line100-Line0)*1.382;
Line13 = Line0 - abs(Line100-Line0)*1.500;
Line14 = Line0 - abs(Line100-Line0)*1.618;
Line15 = Line0 - abs(Line100-Line0)*1.764;
Line16 = Line0 - abs(Line100-Line0)*1.855;
Line17 = Line0 - abs(Line100-Line0)*2.00;
}
}

// external fib lines begining fom selecetdbarindex()
fib0= LineArray(startbar, Line0, finishbar, Line0, 0, 1);
fib100 = LineArray(startbar, Line100, finishbar, Line100, 0, 1);

// depth of middle lines
n= round((finishbar-startbar)/2);

// middle lines
fib1= LineArray((finishbar-n), Line1, finishbar, Line1, 0, 1);
fib2= LineArray((finishbar-n), Line2, finishbar, Line2, 0, 1);
fib3= LineArray((finishbar-n), Line3, finishbar, Line3, 0, 1);
fib4= LineArray((finishbar-n), Line4, finishbar, Line4, 0, 1);
fib5= LineArray((finishbar-n), Line5, finishbar, Line5, 0, 1);
fib6= LineArray((finishbar-n), Line6, finishbar, Line6, 0, 1);
fib7= LineArray((finishbar-n), Line7, finishbar, Line7, 0, 1);
fib8= LineArray((finishbar-n), Line8, finishbar, Line8, 0, 1);
fib9= LineArray((finishbar-n), Line9, finishbar, Line9, 0, 1);
fib10= LineArray((finishbar-n), Line10, finishbar, Line10, 0, 1);
fib11= LineArray((finishbar-n), Line11, finishbar, Line11, 0, 1);
fib12= LineArray((finishbar-n), Line12, finishbar, Line12, 0, 1);
fib13= LineArray((finishbar-n), Line13, finishbar, Line13, 0, 1);
fib14= LineArray((finishbar-n), Line14, finishbar, Line14, 0, 1);
fib15= LineArray((finishbar-n), Line15, finishbar, Line15, 0, 1);
fib16= LineArray((finishbar-n), Line16, finishbar, Line16, 0, 1);
fib17= LineArray((finishbar-n), Line17, finishbar, Line17, 0, 1);
fib18= LineArray((finishbar-n), Line18, finishbar, Line18, 0, 1);
Plot(fib0,"", colorWhite);
Plot(fib100,"", colorRed);
Plot(fib1,"0.0%=", colorOrange);
Plot(fib2,"14.5%=", colorRed);
Plot(fib3,"23.6%=", colorRed);
Plot(fib4,"38.2%=", colorRed);
Plot(fib5,"50.0%=", colorRed);
Plot(fib6,"61.8%=", colorRed);
Plot(fib7,"76.4%=", colorRed);
Plot(fib8,"85.5%=", colorRed);
Plot(fib9,"100.0%=", colorRed);
Plot(fib10,"114.5%=", colorRed);
Plot(fib11,"123.6%=", colorRed);
Plot(fib12,"138.2%=", colorRed);
Plot(fib13,"150%=", colorRed);
Plot(fib14,"161.8%=", colorRed);
Plot(fib15,"176.4%=", colorRed);
Plot(fib16,"185.5%=", colorRed);
Plot(fib17,"200.0%=", colorRed);
//Plot(fib18,"", colorPink);



Title = Name() + " - Auto FIB LEVELS "
+"\n"+EncodeColor(colorRed)+"0.0% = "+line1
+"\n"+EncodeColor(colorRed)+"14.5% = "+line2
+"\n"+EncodeColor(colorRed)+"23.6% = "+line3
+"\n"+EncodeColor(colorRed)+"38.2% = "+line4
+"\n"+EncodeColor(colorRed)+"50.0%= "+line5
+"\n"+EncodeColor(colorRed)+"61.8%= "+line6
+"\n"+EncodeColor(colorRed)+"76.4%= "+line7
+"\n"+EncodeColor(colorRed)+"85.5%= "+line8
+"\n"+EncodeColor(colorRed)+"100.0%= "+line9
+"\n"+EncodeColor(colorRed)+"114.5%= "+line10
+"\n"+EncodeColor(colorRed)+"123.6%= "+line11
+"\n"+EncodeColor(colorRed)+"138.2%= "+line12
+"\n"+EncodeColor(colorRed)+"150.0%= "+line13
+"\n"+EncodeColor(colorRed)+"161.8%= "+line14
+"\n"+EncodeColor(colorRed)+"176.4%= "+line15
+"\n"+EncodeColor(colorRed)+"185.5%= "+line16
+"\n"+EncodeColor(colorRed)+"200.0%= "+line17

+"\n "
;
This is afl modified by me, takes HI LOW of last 4 days, n draws levels. U can replace 4 with 1 for last days HI LOW, also u can replace Fibo numbers with ur preferred numbers
 
Last edited:

shanki99

Well-Known Member
#4
will this system do , what you are looking for

if yes please let me know because i have to search for it (Hard search ) in my AFL Collection .

System Name : KAMAS 1.0 System with StoCCI for Amibroker[/B



Yeah most of the Fib lines are dynamic...meaning that it changes with incoming RT data...what iam looking for is something constant based on yday's High and low.....

Still u can share that AFL, if u find time to hard search, as it looks very interesting

Thanx again
 

shanki99

Well-Known Member
#5
/*-----------------------------------------------


This is afl modified by me, takes HI LOW of last 4 days, n draws levels. U can replace 4 with 1 for last days HI LOW, also u can replace Fibo numbers with ur preferred numbers

This looks tough for my kids mind....dont know where it takes those values and what Fib lines it is drawing :confused: :confused:

I tried to change 4 into 1, but in vain....it throws out so many narrow lines :mad:, which is not what iam looking for :mad:

Anyways thanx for ur time and help....
 

singhboy

Active Member
#6
I think u r using it on intraday chart, its for eod chart, It takes last 4 candles. So shift to eod, then look at left hand side, u will see levels
 

singhboy

Active Member
#7
OR just replace 4 with 400, it will take HI LOW of last 400 candles. If ur using 5 day 60 mint candles , maximum candles will b 35, u can replace 4 with 35 n so on
 

Similar threads