| 
 PureBytes Links 
Trading Reference Links 
 | 
"J. Sallen" <pcourt@xxxxxxxxx>
> This indicator counts consecutive closes up and down. Maybe
> someone can find a good use for it.  
Hi Jack,
Actually it looks to me like your indicator plots a summation of the 
ups and downs in the last Len bars -- right?  (I.e. if there were 4 
ups and 6 downs, it would plot -2, regardless of what order they came 
in.)  And that may actually be more useful than the consecutive 
ups/downs.  
Notice that it always jumps by 2, since you're always adding one at 
the end of the Len-long window and removing one from the start.  So 
either the cumulative total remains the same (add one up / remove one 
up, add one down / remove one down) or it changes by 2 (add up / 
remove down, etc).
Here's a slight modification of your indicator that doesn't require 
the CC array.  I've also added an extra plot that does compute the 
consecutive number of ups/downs.  Notice this one never has a value 
of zero, since it goes from "N down closes" to "1 up close" and vice 
versa.
Gary
=============================
{Written: J. Sallen 10/03/98}
Inputs: Len(10);
vars: k(0);
value2 = 0;
For K=0 to Len-1 begin
 IF C[K]>C[K+1] then value2=value2+1
                else value2=value2-1;
end;
plot1(value2,"CC_Count");
Vars: CCount(0);
if (C > C[1]) then begin
  if (CCount > 0) 
    then CCount = CCount+1
    else CCount = 1;
  end
else begin
  if (CCount < 0)
    then CCount = CCount-1
    else CCount = -1;
  end;
plot2(CCount, "CC2");
plot3(0, "");
 |