16 December 2010



Pivot Identifier (Amibroker AFL)
Price pivots are best conceptualized with three bars. A three-bar pivot low represents support and is formed when buying pressure turns price from down to up. It is designated by a price bar with a higher low that closes above the previous bar's high, where the previous bar's low is lower than the bar that preceded it. This is true in every time frame.

A three-bar pivot high represents resistance and is formed when sellers turn price from up to down. It is seen where a price bar with a lower high closes below the previous bar's low, where the previous bar's high is higher than the bar that preceded it. Structural pivots are more easily recognized and understood when seen in a diagram or on a price chart. This is true in every time frame. (See the below mentioned figure)


Now I introduce the Pivot identifier AFL for Amibroker. You can also identify important supports and resistances in any time frame. The AFL is as follows (also an image attached):

http://2.bp.blogspot.com/_-XgafoM-JX0/TBo8PTCgomI/AAAAAAAAEr8/btyErbOnn2A/s320/Pivot+Identifier.png

_SECTION_BEGIN("Pivot Identifier");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

dist = 0.5*ATR(10);
//code and plot the pivot top
PivotTop = L < Ref(L,-1) AND H < Ref(H,-1) AND Ref(L,-1) < Ref(L,-2) AND Ref(H,-1) < Ref(H,-2) AND Ref(H,-2) > Ref(H,-3) AND Ref(L,-2) > Ref(L,-3);
PivotBottom = H > Ref(H,-1) AND L > Ref(L,-1) AND
Ref(H,-1) > Ref(H,-2) AND Ref(L,-1) > Ref(L,-2) AND
Ref(L,-2) < Ref(L,-3) AND Ref(H,-2) < Ref(H,-3);
for( i = 0; i < BarCount; i++ )
{
if( PivotTop [i] ) PlotText( "PVT", i-2, H[ i-2 ], colorGreen );
if( PivotBottom [i] ) PlotText( "PVB", i-2, L[ i-2 ] - dist[i] , colorRed );
}
_SECTION_END();

No comments:

My Blog List

Total Pageviews

Search This Blog

Followers

Blog Archive