HI experts
Can somebody give some hints and images on how to apply this unique fibonacci code by Abdul kareem.
what setting to be used for zoom, beginbar, endbar,other setting options!
the color combination is a bit difficult.
what settings are needed for zoom,beginbar,endbar and other parameters-please help
regards
ford
Can somebody give some hints and images on how to apply this unique fibonacci code by Abdul kareem.
what setting to be used for zoom, beginbar, endbar,other setting options!
the color combination is a bit difficult.
what settings are needed for zoom,beginbar,endbar and other parameters-please help
regards
ford
HTML:
//-Fibonacci retracements, Fan, Time Zones and Time Extensions.
//- Speed resistance
//Formula:
_SECTION_BEGIN("Fibonacci Calculations & Speed Resistance");
///////////////////////////////////////////////////////////////////////////
// ABDULKAREEM ALGHAMDI - JAN2012
// Fibonacci Retracements, Fan, Time extension and time zones
// Speed Resistance
///////////////////////////////////////////////////////////////////////////
//Parameters
///////////////////////////////////////////////////////////////////////////
GraphXSpace = Param("Zoom",2,1);
begin = Param("Begin Bar",0, 0, 2000);
end = Param("End Bar",0, 0, 2000);
FibRetr = ParamToggle("Fibonacci Retr./Resistance","No|Yes", 1);
ShowFibExt = ParamToggle("Show Fib Retr. Extensions", "No|Yes");
SpeedRes = ParamToggle("Show Speed Resistance","No|Yes");
FibExt= ParamToggle("Show Fibonacci Extension","No|Yes");
FibTime= ParamToggle("Show Fibonacci Time Zones","No|Yes");
///////////////////////////////////////////////////////////////////////////
//Calculations
///////////////////////////////////////////////////////////////////////////
up = LastValue(Ref(H, -begin)) > LastValue(Ref(L, -end))==0;
BeginXPoint = BarCount-1-begin;
EndXPoint = BarCount-1-end;
LVLine = LastValue(BarIndex());
VLine = BarIndex();
FibNumbers[0] = 0;
FibNumbers[1] = 0.236;
FibNumbers[2] = 0.382;
FibNumbers[3] = 0.5;
FibNumbers[4] = 0.618;
FibNumbers[5] = 0.764;
FibNumbers[6] = 1;
FibNumbers[7] = 1.27;
FibNumbers[8] = 1.618;
FibNumbers[9] = 2;
FibNumbers[10] = 2.24;
FibNumbers[11] = 2.618;
FibNumbers[12] = 3.14;
if(up)
{
BeginYPoint = LastValue(Ref(L, -begin));
EndYPoint = LastValue(Ref(H, -end));
}
else
{
BeginYPoint =LastValue( Ref(H, -begin));
EndYPoint = LastValue(Ref(L, -end));
}
Range= (BeginYPoint-EndYPoint);
///////////////////////////////////////////////////////////////////////////
// Plotting
///////////////////////////////////////////////////////////////////////////
Plot(C, "", IIf(C > O, colorGreen, colorRed), styleBar);
if (begin > End)
{
if(FibRetr)//Fibonacci Retracements
{
for(i=0; i<IIf(ShowFibExt, 12, 7); i++)
{
Plot(LineArray(BeginXPoint, EndYpoint+Range*FibNumbers[i], EndXPoint,
EndYpoint+Range*FibNumbers[i],1),"", colorBrightGreen, styleDashed);
Plot(LineArray(BeginXPoint, BeginYPoint , EndXPoint,
EndYpoint+Range*FibNumbers[i]),"", colorBrightGreen,
styleDashed|styleNoLabel);
Plot(LineArray(EndXPoint, EndYpoint+Range*FibNumbers[i], BarCount-1,
BeginYPoint ),"", colorBrightGreen, styleDashed|styleNoLabel);
PlotText(StrFormat("%.1f%%", FibNumbers[i]*100), beginxpoint,
EndYPoint+Range*FibNumbers[i], colorBlack, 5);
}
}
if(SpeedRes)//Speed Resistance
{
//From Begin to End
Plot(LineArray(BeginXPoint, BeginYPoint, EndXPoint, EndYPoint), "",
colorBrightGreen, styleDashed|styleNoLabel);
Plot(LineArray(BeginXPoint, BeginYPoint, EndXPoint, BeginYPoint-Range*.333),
"", colorBrightGreen, styleDashed|styleNoLabel);
Plot(LineArray(BeginXPoint, BeginYPoint, EndXPoint, BeginYPoint-Range*.666),
"", colorBrightGreen, styleDashed|styleNoLabel);
// From End to barcount - 1
Plot(LineArray(EndXPoint, EndYPoint, BarCount-1, BeginYPoint), "",
colorBrightGreen, styleDashed|styleNoLabel);
Plot(LineArray(EndXPoint, BeginYPoint-Range*.333, BarCount-1, BeginYPoint),
"", colorBrightGreen, styleDashed|styleNoLabel);
Plot(LineArray(EndXPoint, BeginYPoint-Range*.666, BarCount-1, BeginYPoint),
"", colorBrightGreen, styleDashed|styleNoLabel);
// Horizontal Lines
Plot(LineArray(BeginXPoint, BeginYPoint, EndXPoint , BeginYPoint, 1), "",
colorBrightGreen, styleDashed);
Plot(LineArray(BeginXPoint, BeginYPoint-Range*.333, EndXPoint ,
BeginYPoint-Range*.333, 1), "", colorBrightGreen, styleDashed);
Plot(LineArray(BeginXPoint, BeginYPoint-Range*.666, EndXPoint ,
BeginYPoint-Range*.666, 1), "", colorBrightGreen, styleDashed);
Plot(LineArray(BeginXPoint, EndYPoint , EndXPoint , EndYPoint , 1), "",
colorBrightGreen, styleDashed);
//
PlotText(StrFormat("%.2f", BeginYPoint), BarCount-1-begin, BeginYPoint,
colorBlack, 5);
PlotText("0.333%", BarCount-1-begin, BeginYPoint-Range*.333, colorBlack, 5);
PlotText("0.666%", BarCount-1-begin, BeginYPoint-Range*.666, colorBlack, 5);
PlotText(StrFormat("%.2f", EndYPoint), BeginXPoint, EndYPoint, colorBlack,
5);
}
}
if(FibExt)//Fibonacci time extensions
{
Plot((Line=VLine == LVLine -begin),"", colorBrightGreen, styleHistogram|
styleOwnScale|styleNoLabel);
Plot((Line=VLine == LVLine -end) ,"", colorBrightGreen, styleHistogram|
styleOwnScale|styleNoLabel);
for(i=0; i<10; i++)
{
Plot((Line=VLine == LVLine -end + int((begin -end+1)*FibNumbers[i])) ,"",
colorBrightGreen, styleHistogram| styleOwnScale|styleNoLabel|styleDashed);
PlotText(StrFormat("%.1f%%", FibNumbers[i]*100), BarCount-end+int((begin
-end+1)*FibNumbers[i]), HighestVisibleValue(H), colorBlack, 5);
}
}
if(FibTime)//Fibonacci time zones
{
k=1;
j = 2;
for(i = 1;i<=20;i++)
{
Plot((Line=VLine == LVLine -(begin-k+1)),"", colorBrightGreen,
styleHistogram| styleOwnScale|styleNoLabel);
PlotText(StrFormat("%.0f", j-k), BarCount-begin+k-2,
HighestVisibleValue(H),colorBlack, 5);
j = j+k;
k = j-k;
}
}
Title = FullName()+" , "+Date()+", O="+O+", H="+H+", L="+L+", C="+C+", Bars
To End:"+(BarCount - 1 - BarIndex());
_SECTION_END();
Last edited: