[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help need indicator for running count.



PureBytes Links

Trading Reference Links

At 2:16 AM -0700 12/3/99, Brent wrote:

>Hi, I am trying to make an indicator that will plot a running count like 4,
>8, 12, 16 . . .  on my chart starting from a specified date and only
>plotting (the count)above every fourth bar. I gave it a try (see below) and
>although the count is right, I get the count plotted above every bar instead
>of every fourth one. Thanks.

Try the following (untested but probably close to correct)

Bob Fulks

-----------


Input: COLOR(Tool_White), Strtdate(0), Run(4);
Var: count(0), newtext(0), sbar(0);

if date = Strtdate then
         sbar = currentbar;

if sbar <> 0 then begin
    count = count + 1;
    if  Mod(count,Run) = 0 then begin;
       newtext=text_new(date,time,H,numtostr(count,0));
       text_setstyle(newtext,2,1);

       If GetBackGroundColor=Tool_White then Value4=Text_SetColor(newtext,
          Tool_Red)
       Else Value4=Text_SetColor(newtext, Color); {changes numbers to red for
          white charts.}
    end;
end;

if false then plot1(C,"");