help plz. a = a + b syntax error?

#1
AdjY = BarsSince(dn) + AdjY

why it has syntax error? I cannot add two variable together?

up = C > MA(C,20);
dn = C < MA(C,20);
up = ExRem(up,dn);
dn = ExRem(dn,up);

X = IIf(BarsSince(up) < BarsSince(dn), BarsSince(up),0);
Y = IIf(BarsSince(up) > BarsSince(dn), BarsSince(dn), 0);

//AdjY = StaticVarGet("mystaticarray" );

AdjY = IIf(BarsSince(up) > BarsSince(dn),
BarsSince(dn) + AdjY​
, IIf (HHV(y,3) > 5,Ref(y,-1),0));
 
#4
Try this


Code:
up	=	C > MA(C,20);
dn	=	C < MA(C,20);
up	=	ExRem(up,dn);
dn	=	ExRem(dn,up);

X	=	IIf(BarsSince(up) < BarsSince(dn), BarsSince(up),0);
Y	=	IIf(BarsSince(up) > BarsSince(dn), BarsSince(dn), 0);

//AdjY = StaticVarGet("mystaticarray" ); 
AdjY[0] =	0; //initialize it before using on right side of equation
AdjY	=	IIf(BarsSince(up) > BarsSince(dn), BarsSince(dn) + AdjY, IIf (HHV(y,3) > 5,Ref(y,-1),0));
 

Similar threads

Trade in Rs 20, No more % brokerage

Name:Phone:
Email:City:
State:
Are you a day trader?