[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Fib AFL Help



PureBytes Links

Trading Reference Links


Try the function below; Just pass it the peak & trough values:

p1=Peak(H,1,1);
t1=Trough(L,1,1);

myf_autoFib(p1,t1,True);
Plot(C,"c",colorRed);

Walt

//-------------------------------------------
 function myf_autoFib( p0, p100, plotIt)
{
global fbp0;
global fbp50;
global fbp100;
global fbp38_2;
global fbp61_8;
global fbp127_2;
global fbpm27_2;
global fbp161_8;

  fibar= Cum( 1) ;
res= 0;
if ( LastValue( BarIndex( ) )  > 8 ) 
{

  diff=  ( p100- p0) ;
  fibar[0]= LastValue( fbp0= p0) ;
  fibar[1]= LastValue( fbpm27_2= fbp0+(diff*.272 ) );
  fibar[2]= LastValue( fbp38_2= fbp0+(diff*.382) ) ;
  fibar[3]= LastValue( fbp50= fbp0+(diff*.5) ) ;
  fibar[4]= LastValue( fbp61_8= fbp0+(diff*.618) ) ;
  fibar[5]= LastValue( fbp100= fbp0+(diff)) ;
  fibar[6]= LastValue( fbp127_2=fbp0+(diff*1.272) ) ;
  fibar[7]= LastValue( fbp161_8= fbp0+( diff*1.618) ) ;
  res= 0;

  if ( plotit== True)
  {
  Plot( fbp0, "", colorPink) ;
  Plot( fbp50, "", colorYellow) ;
  Plot( fbp100, "", colorPink) ;
  Plot( fbp38_2, "", colorLime) ;
  Plot( fbp61_8, "", colorLime) ;
  // Plot( fbp127_2, "", colorAqua) ;
  //Plot( fbpm27_2, "", colorAqua) ;
  //Plot( fbp161_8, "", colorLime) ;
  }

}
return res;
}



--- In amibroker@xxxxxxxxxxxxxxx, "jism1992" <gdihia@xxxx> wrote:
> 
> Hi dear friends,
> 
> I have the following Fib lines AFL, but it doesn't work intraday
> properly. The chart scale is way off. What shall I do to modify it? 
If
> you have a better auto fib lines AFL file, please post it. Thanks.
> 
>  MaxGraph=8;
> p1=Peak(H,10,1);
> Graph0=p1;
> t1=Trough(L,5,1);
> Graph2=t1;
> Graph2Style=1;
> df=p1-t1;
> f1=t1+0.38*df;
> f2=t1+0.5*df;
> f3=t1+0.618*df;
> Graph1=f1;
> Graph3=f2;
> Graph4=f3;
> Graph5=Close;
> Graph5Style=64;
> Graph1Color=6;
> Graph3Color=8;
> Graph4Color=12;








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/