The AFL code for De Mark's interpretation of Elliott waves or D waves is available on the net:-
There are 2 versions:-
Version A
PreTD1= C==LLV(C,21);
TD1= follows PreTD1 and C== HHV(C,13) ;
TD2= follows TD1 and C==LLV(C,8);
TD3= follows ...and.. C==HHV(C,21);
TD4= follows ...and..C==LLV(C,13);
TD5= follows ...and..C==HHV(C,34);
TDA= follows ...and..C==LLV(C,13);
TDB= follows ...and..C==HHV(C,8);
TDC= follows ...and..C==LLV(C,21);
Version B
//Patterns Wave
_SECTION_BEGIN("Patterns Wave");
Change = Param("Wave Period",7,0,100,1);
SupResA = Param("Sup-Res A Period",20,0,100,1);
SupResB = Param("Sup-Res B Period",25,0,100,1);
Res1 = ParamColor("Resistance High", colorRed );
Res2 = ParamColor("Resistance Low", colorDarkRed );
Sup1 = ParamColor("Support High", colorDarkGreen );
Sup2 = ParamColor("Support Low", colorBrightGreen );
procedure PlotShapeAt( x, y, shape, shift )
{
PlotShapes( IIf( BarIndex() == x, shape, 0 ), colorWhite, 0, y,
shift );
}
bi = BarIndex();
sbi = SelectedValue( bi );
GraphXSpace = 2;
Plot( Zig( C, Change ), "", colorWhite, styleThick );
upshift = 15;
if( SelectedValue( PeakBars( C, Change ) < TroughBars( C, Change ) ) )
{
pt1 = PeakBars( C, Change, 1 ) == 0 ;
pt2 = TroughBars( C, Change, 1 ) == 0 ;
}
else
{
pt1 = TroughBars( C, Change, 1 ) == 0 ;
pt2 = PeakBars( C, Change, 1 ) == 0 ;
upshift = -upshift;
}
bpt1 = SelectedValue( ValueWhen( pt1, bi ) );
bpt2 = SelectedValue( ValueWhen( pt2, bi ) );
bpt3 = SelectedValue( ValueWhen( pt1, bi, 2 ) );
bpt4 = SelectedValue( ValueWhen( pt2, bi, 2 ) );
bpt5 = SelectedValue( ValueWhen( pt1, bi, 3 ) );
bpt6 = SelectedValue( ValueWhen( pt2, bi, 3 ) );
PlotShapeAt( bpt1, C, shapeDigit5, upshift );
PlotShapeAt( bpt2, C, shapeDigit4, -upshift );
PlotShapeAt( bpt3, C, shapeDigit3, upshift );
PlotShapeAt( bpt4, C, shapeDigit2, -upshift );
PlotShapeAt( bpt5, C, shapeDigit1, upshift );
Plot( C, "", colorWhite, styleThick + styleCandle);
_SECTION_END();
Both these versions give syntax and other errors when installed as custom indicators in Amibroker.
There are 2 versions:-
Version A
PreTD1= C==LLV(C,21);
TD1= follows PreTD1 and C== HHV(C,13) ;
TD2= follows TD1 and C==LLV(C,8);
TD3= follows ...and.. C==HHV(C,21);
TD4= follows ...and..C==LLV(C,13);
TD5= follows ...and..C==HHV(C,34);
TDA= follows ...and..C==LLV(C,13);
TDB= follows ...and..C==HHV(C,8);
TDC= follows ...and..C==LLV(C,21);
Version B
//Patterns Wave
_SECTION_BEGIN("Patterns Wave");
Change = Param("Wave Period",7,0,100,1);
SupResA = Param("Sup-Res A Period",20,0,100,1);
SupResB = Param("Sup-Res B Period",25,0,100,1);
Res1 = ParamColor("Resistance High", colorRed );
Res2 = ParamColor("Resistance Low", colorDarkRed );
Sup1 = ParamColor("Support High", colorDarkGreen );
Sup2 = ParamColor("Support Low", colorBrightGreen );
procedure PlotShapeAt( x, y, shape, shift )
{
PlotShapes( IIf( BarIndex() == x, shape, 0 ), colorWhite, 0, y,
shift );
}
bi = BarIndex();
sbi = SelectedValue( bi );
GraphXSpace = 2;
Plot( Zig( C, Change ), "", colorWhite, styleThick );
upshift = 15;
if( SelectedValue( PeakBars( C, Change ) < TroughBars( C, Change ) ) )
{
pt1 = PeakBars( C, Change, 1 ) == 0 ;
pt2 = TroughBars( C, Change, 1 ) == 0 ;
}
else
{
pt1 = TroughBars( C, Change, 1 ) == 0 ;
pt2 = PeakBars( C, Change, 1 ) == 0 ;
upshift = -upshift;
}
bpt1 = SelectedValue( ValueWhen( pt1, bi ) );
bpt2 = SelectedValue( ValueWhen( pt2, bi ) );
bpt3 = SelectedValue( ValueWhen( pt1, bi, 2 ) );
bpt4 = SelectedValue( ValueWhen( pt2, bi, 2 ) );
bpt5 = SelectedValue( ValueWhen( pt1, bi, 3 ) );
bpt6 = SelectedValue( ValueWhen( pt2, bi, 3 ) );
PlotShapeAt( bpt1, C, shapeDigit5, upshift );
PlotShapeAt( bpt2, C, shapeDigit4, -upshift );
PlotShapeAt( bpt3, C, shapeDigit3, upshift );
PlotShapeAt( bpt4, C, shapeDigit2, -upshift );
PlotShapeAt( bpt5, C, shapeDigit1, upshift );
Plot( C, "", colorWhite, styleThick + styleCandle);
_SECTION_END();
Both these versions give syntax and other errors when installed as custom indicators in Amibroker.