Consecutive Closes Up or down

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

Consecutive Closes Up or down

Post by henry1224 »

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;
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

Re: Consecutive Closes Up or down

Post by henry1224 »

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;
nibor200
Posts: 63
Joined: Wed Oct 22, 2014 11:03 am

Re: Consecutive Closes Up or down

Post by nibor200 »

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.
Post Reply