### Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
Find Out More Here

#1 Selling Amibroker Plugin featuring:

Neural Networks
And Much More ....
Find Out More Here

### Fibonacci Retracements fixed to 12.5% for Amibroker (AFL) ANANDS 23 days ago Amibroker (AFL)

Rating:
Tags:
amibroker, fibonacci, study

This great code was created by Panos on the amibroker forums. It allows you to plot fib retracements at 12.5% increments. To use it you need to draw a trendline from the high point where you want the fib retracements to start to a low point. Next you need to select the trendline and go to properties and set the ‘Study ID’ to ‘P1’. Once done you should see the fib retracements plotted. You can check out the full forum post here

### Indicator / Formula

```_SECTION_BEGIN("xFibo_with_Color_fixed");
/** Fibonacci Retracements fixed to 12.5%
// 12.5%, 25%, 37.5%, 50%, 62.5%, 75%, 87.5%
// By Panos Version 1   21-Oct-2017  xFibo with GfxLines
// example = xFibo("F1",colorYellow, 150 );
*/

Plot( C, "", colorDefault, styleCandle );

GfxSetOverlayMode( 1 );
GfxSetCoordsMode( 1 ); // bar/price mode (instead of pixel)

function  xFibo( StudyID, Color, extend )
{
trendline = Study( StudyID, GetChartID() );

X1 = StartX = LastValue( ValueWhen( ExRem( trendline, 0 ), BarIndex() ) );
X2 = EndX = LastValue( ValueWhen( trendline, BarIndex() ) );		//	printf("X1 StartX  = %g,\n X2 EndX = %g\n", StartX, EndX );
Y1 = StartY = LastValue( ValueWhen( ExRem( trendline, 0 ), trendline ) );
Y2 = EndY = LastValue( ValueWhen( trendline, trendline ) );			//	printf("\nY1 StartY  = %g,\nY2  EndY = %g\n", StartY, EndY );

DiffY = ( Y2 - Y1 ) ;
GfxSelectPen( Color );

// Show me the lines 12.5%, 25%, 37.5%, 50%, 62.5%, 75%, 87.5%, 100%
for( i = 0; i <= 1 ; i = i + 0.125 )
{
// printf( "\n i " + i );
lineY = Y2 - ( DiffY * i );
GfxMoveTo( StartX, lineY );  GfxLineTo( EndX + extend , lineY );
}
}

extend= Param("Extent Lines", 0, -200, 200,10 );
xFibo("P1",colorDarkOliveGreen, extend ) ;
xFibo("P2",colorBlueGrey, extend);
xFibo("P3",colorAqua,extend);
_SECTION_END();```

1.

not working