Type : Indicator, Name : MATCH
INPUT:
LENGTH(2),
PERCENT(5);
vars:
dc(o),
dc1(o),
dh(0),
dh1(0),
dl(0),
dl1(0),
YY(0),
EE(0),
RR(10000),
A1(0),
A2(0),
A3(0),
FF(0);
BEGIN;
YY=0;
FOR EE = 1 TO LENGTH BEGIN;
FF= EE-1;
DC = (close — open)/open*RR;
DC1 = (close[FF]-open[FF])/open[FF]*RR;
DH = (high — open)/open*RR;
DH1= (high[FF]-open[FF])/open[FF]*RR;
DL = (low-open)/open*RR;
DL1 = (low[FF]-open[FF])/open[FF]*RR;
A1= (DC-DC1) ;
A2= (DH-DH1) ;
A3= (DL-DL1) ;
IF ABSVALUE(A1)>=PERCENT THEN YY=YY+1;
IF ABSVALUE(A2)>=PERCENT THEN YY=YY+1;
IF ABSVALUE(A3)>= PERCENT THEN YY=YY+1;
END;
plot2(YY*10,»MATCH»);
END;