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

Re: [amibroker] [#28719] Amibroker question and fibonacci



PureBytes Links

Trading Reference Links

Tony,

Here is an auto fib retracement AFL I've been diddling with for a while. 
I got it from the AFL library and altered it to show the fib lines 
similar to those shown in your example. There are also Tom DeMark magnet 
lines shown. Just double click on the high and low you want to calculate 
the fibs from. I don't know how to get the text at the lines. If it's 
possible, maybe someone on the forum could clue us in to that part.

Enjoy!

Wayne

_SECTION_BEGIN("Fibo Levels");
/*---------------------------------------------------
    Another Fib Level
    Based on Aron Pipa's formula , December, 11, 2005
   
   * Under Parameters, select "axis & Grid" ,  "show date axis" = "yes"
    * Dash lines are the fib extentions
    * If you are not familiar with begin/end values double
    click a lot around the screen til you get the idea
    * Select your fib retrace in a higher timeframe e.g.
    daily and view chart in e.g. 5 min, to see major
    retracement  lines.
--------------------------------------------------------*/
EnableTextOutput(0);

// Get values for fib levels
StartBar=BeginValue(BarIndex());
FinishBar = EndValue( BarIndex() );
LastBar=BarCount-1;
period = FinishBar - StartBar;
Lo =LLV(L,period);
Hi = HHV(H,period);
Offset= Param("Offset Fib Lines?",20,0,40,5);

Line0=0;
Line100=0;
Line1=0;
Line2=0;
Line3=0;
Line4=0;
Line5=0;
magnet1=0;
magnet2=0;

i = startbar;
for( i = startbar; i < finishbar; i++ )
{
Line100 = EndValue(L);
Line0 = BeginValue(H);
Line1 = Line100 + abs(Line0-Line100)*0.236;
Line2 = Line100 + abs(Line0-Line100)*0.382;
Line3 = Line100 + abs(Line0-Line100)*0.5;
Line4 = Line100 + abs(Line0-Line100)*0.618;
Line5 = Line100 + abs(Line0-Line100)*0.764;
magnet1 =   EndValue(C);
magnet2 = BeginValue(C);
}

// fib lines, the "x" is the extension
fib0= LineArray(startbar, Line0, finishbar, Line0, 0, 1);
fib0x= LineArray(finishbar, Line0, Lastbar, Line0, 0, 1);
fib100 = LineArray(startbar, Line100, finishbar, Line100, 0, 1);
fib100x = LineArray(finishbar, Line100, Lastbar, Line100, 0, 1);

fib1= LineArray(startbar, Line1, finishbar, Line1, 0, 1);
fib1x= LineArray(finishbar, Line1, Lastbar, Line1, 0, 1);
fib2= LineArray(startbar, Line2, finishbar, Line2, 0, 1);
fib2x= LineArray(finishbar, Line2, Lastbar, Line2, 0, 1);
fib3= LineArray(startbar, Line3, finishbar, Line3, 0, 1);
fib3x= LineArray(finishbar, Line3, Lastbar, Line3, 0, 1);
fib4= LineArray(startbar, Line4, finishbar, Line4, 0, 1);
fib4x= LineArray(finishbar, Line4, Lastbar, Line4, 0, 1);
fib5= LineArray(startbar, Line5, finishbar, Line5, 0, 1);
fib5x= LineArray(finishbar, Line5, Lastbar, Line5, 0, 1);
mag1= LineArray(startbar, magnet1, finishbar, magnet1, 0, 1);
mag1x= LineArray(finishbar, magnet1, Lastbar, magnet1, 0, 1);
mag2= LineArray(startbar, magnet2, finishbar, magnet2, 0, 1);
mag2x= LineArray(finishbar, magnet2, Lastbar, magnet2, 0, 1);



// Plot
Plot(C,"", colorWhite,styleCandle);
Plot(fib0,"", colorYellow,styleDashed|styleNoRescale);
Plot(fib0x,"", colorYellow,styleDashed|styleNoRescale,Null,Null,Offset);
Plot(fib100,"", colorYellow,styleDashed|styleNoRescale);
Plot(fib100x,"", colorYellow,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(fib1,"", colorAqua,styleNoRescale);
Plot(fib1x,"", colorAqua,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(fib2,"", colorBlue,styleNoRescale);
Plot(fib2x,"", colorBlue,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(fib3,"", colorWhite,styleDashed|styleNoRescale);
Plot(fib3x,"", colorWhite,styleDots|styleNoRescale,Null,Null,Offset);
//Plot(fib4,"", colorBlue,styleNoRescale);
Plot(fib4x,"", colorBlue,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(fib5,"", colorAqua,styleNoRescale);
Plot(fib5x,"", colorAqua,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(mag1,"", colorBlueGrey,styleNoRescale);
Plot(mag1x,"", colorBlueGrey,styleDashed|styleNoRescale,Null,Null,Offset);
//Plot(mag2,"", colorBlueGrey,styleNoRescale);
Plot(mag2x,"", colorBlueGrey,styleDashed|styleNoRescale,Null,Null,Offset);

// Title

Title= "TD Relative Retracements   "+EncodeColor(42)+Name()+"   "+ 
(Interval()/60)+" min  "+EncodeColor(55)+Date()+
"  O="+WriteVal(O,1.4)+
"  H="+WriteVal(H,1.4)+
"  L="+WriteVal(L,1.4)+ EncodeColor(42)+
"  C="+WriteVal(C,1.4)+ EncodeColor(9)+
"  Last C=" + WriteVal((Ref(C,-1)),1.4)+ EncodeColor(34)+
"\n"+
EncodeColor( colorWhite )  + " 100%  = "+EncodeColor(55)+Line100 +
"\n"+
EncodeColor( colorWhite )  + " magnet  = 
"+EncodeColor(colorBlueGrey)+Magnet2 +
"\n"+
EncodeColor( colorWhite )  + " 76.4% = "+EncodeColor( colorAqua )+Line5   +
"\n"+
EncodeColor( colorWhite )  + " 61.8% = "+EncodeColor( colorBlue )+Line4   +
"\n"+
EncodeColor( colorWhite )  + " 50.0% = "+EncodeColor( colorWhite 
)+Line3   +
"\n"+
EncodeColor( colorWhite )   + " 38.2% = "+EncodeColor( colorBlue 
)+Line2   +
"\n"+
EncodeColor( colorWhite )    + " 23.6% = "+EncodeColor( colorAqua 
)+Line1   +
"\n"+
EncodeColor( colorWhite )  + " magnet  = 
"+EncodeColor(colorBlueGrey)+Magnet1 +
"\n"+
EncodeColor( colorWhite )  + "   0% = "+EncodeColor(55)+Line0;
_SECTION_END();

Tony Lei wrote:

> Tomasz and other programmers,
>
> Is it possible to customize the fibonacci retracements to look like 
> the following link?
>
> http://www.foxfutures.com/forexs/indexJD3.cfm
>
> The only method a programmer recommended me to do was to draw 
> trendlines and assign a study ID to each individual line.  But the 
> lines were drawn on top of the bars even if I set the color to 
> background.   Also, it was inefficient because of the time spent 
> typing the ID for each trendline.
>
> Any help or suggestions are welcome
>
> thanks
>
> tony
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
>
>
>
> SPONSORED LINKS
> Investment management software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ> 
> 	Real estate investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA> 
> 	Investment property software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw> 
>
> Software support 
> <http://groups.yahoo.com/gads?t=ms&k=Software+support&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w> 
> 	Real estate investment analysis software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+analysis+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw> 
> 	Investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "amibroker
>       <http://groups.yahoo.com/group/amibroker>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/