here is the code to count consecutive closes up or down
CU:= C>Ref(C,1);
CD:= C<Ref(C,1);
CCU:BARSSINCEWITHRESET(CU,CD),ColorGreen;
CCD:BARSSINCEWITHRESET(CD,CU),ColorRed;
FillRgn(CCU>0,0,CCU),Brush#50008000;
FillRgn(CCD>0,0,CCD),Brush#50800000;
Consecutive Closes Up or down
Moderator: Chris White
Re: Consecutive Closes Up or down
here is another way to write the code
dn:= C - REF(C, 1) < 0;
up:= C - REF(C, 1) > 0;
totalcountdn:= SUM(dn);
totalcountup:= SUM(up);
countdn: totalcountdn - VALUEWHEN(totalcountdn, up),ColorRed;
countup: totalcountup - VALUEWHEN(totalcountup, dn),ColorGreen;
dn:= C - REF(C, 1) < 0;
up:= C - REF(C, 1) > 0;
totalcountdn:= SUM(dn);
totalcountup:= SUM(up);
countdn: totalcountdn - VALUEWHEN(totalcountdn, up),ColorRed;
countup: totalcountup - VALUEWHEN(totalcountup, dn),ColorGreen;
Re: Consecutive Closes Up or down
Henry1224,
Chris uses the phrase "BARSSINCEWITHRESET" in his latest template script but I can't find a reference for it in the Edgerater online documentation nor the Metastock documentation.
I notice that you used it back in Nov.
Do you have an alternate source of script language documentation that explains this command?
Thanks,
Ed S.
Chris uses the phrase "BARSSINCEWITHRESET" in his latest template script but I can't find a reference for it in the Edgerater online documentation nor the Metastock documentation.
I notice that you used it back in Nov.
Do you have an alternate source of script language documentation that explains this command?
Thanks,
Ed S.