can anyone fix the bugs

#1
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.
 

extremist

Well-Known Member
#2
@forexsolution4u2013

either u didn't posted the complete code or u don't have the complete code.
or may be u don't want to share the complete code.

if u could share complete idea here we have really good experts who could help u

but any ways as i checked the codes u posted.
version A is not the AFL code.
means if u want to run it direct it wont run coz those r some sort of indications for the code.

And Pattern B

surely it is a simple Zig code with numbering done with some unnecessary lines in it or the leftovers. but the code is fine it works.


unnecessary lines :
Res1 = ParamColor("Resistance High", colorRed );
Res2 = ParamColor("Resistance Low", colorDarkRed );
Sup1 = ParamColor("Support High", colorDarkGreen );
Sup2 = ParamColor("Support Low", colorBrightGreen );
 
Last edited:
#3
````````````````````
 
Last edited:
#4
hi
here you go.

your afl is this
HTML:
//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();