California
Experience: Intermediate
Platform: Multicharts
Trading: Futures
Posts: 6 since Mar 2012
Thanks Given: 5
Thanks Received: 0
|
Hello master EL programmers...I've been dove into EL head first without a programming background and I'm trying to troubleshoot this code that I came across for a simple pattern signal. When I attempt to compile it it give me an error saying "wrong expression" and highlights the first "NumericSimple" input argument. I have no idea why this is wrong, it even looks identical to the example provided in the editor dictionary.
{#function C_3WhSolds_3BlkCrows}
Inputs:
Length(NumericSimple),
Percent(NumericSimple),
o3WhiteSoldiers( numericref ),
o3BlackCrows( numericref ) ;
variables:
BodyHi( 0 ),
BodyLo( 0 ),
Body( 0 ),
BodyAvg( 0 ),
UpShadow( 0 ),
DnShadow( 0 ),
MyRange( 0 ),
Factor( Percent * .01 ) ;
BodyHi = MaxList( Close, Open ) ;
BodyLo = MinList( Close, Open ) ;
Body = BodyHi - BodyLo ;
BodyAvg = XAverage( Body, Length ) ;
UpShadow = High - BodyHi ;
DnShadow = BodyLo - Low ;
MyRange = High - Low ;
o3WhiteSoldiers = 0 ;
o3BlackCrows = 0 ;
if CurrentBar > 2
and Body > BodyAvg
and Body[1] > BodyAvg[1]
and Body[2] > BodyAvg[2]
{ THREE CONSECUTIVE LONG BODIES }
then
begin
if Close > Open
and Close[1] > Open[1]
and Close[2] > Open[2]
{ ALL THREE BODIES WHITE... }
and Close > Close[1]
and Close[1] > Close[2]
{ ...EACH WITH A HIGHER CLOSE }
and Open < Close[1] and Open > Open[1]
and Open[1] < Close[2] and Open[1] > Open[2]
{ EACH OPEN WITHIN PREVIOUS BODY... }
and UpShadow / MyRange < Factor
and UpShadow[1] / MyRange[1] < Factor
and UpShadow[2] / MyRange[2] < Factor
{ ...AND EACH CLOSE NEAR HIGH }
then
o3WhiteSoldiers = 1
else if Close < Open
and Close[1] < Open[1]
and Close[2] < Open[2]
{ ALL THREE BODIES BLACK... }
and Close < Close[1]
and Close[1] < Close[2]
{ ...EACH WITH A LOWER CLOSE }
and Open > Close[1] and Open < Open[1]
and Open[1] > Close[2] and Open[1] < Open[2]
{ EACH OPEN WITHIN PREVIOUS BODY... }
and DnShadow / MyRange < Factor
and DnShadow[1] / MyRange[1] < Factor
and DnShadow[2] / MyRange[2] < Factor
{ ...AND EACH CLOSE NEAR LOW }
then
o3BlackCrows = 1 ;
end ;
Any help would be appreciated!
|