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

Re: Last Hour In Tick Charts



PureBytes Links

Trading Reference Links

At 12:57 PM -0400 4/30/02, kjh129 wrote:

>Would someone mind showing me a example of an indicator that would be
>used in a tick chart that referance's time rather than bars.
>
>I am looking to create a indicator that only shows the last 1 hour's
>hi and low, but cant use barnumber as some minutes may have 5 tick
>bars to it, and others may have 10 or more. Appreciate anyones help
>in advance.


Try this:


Vars: HHigh(0),       {High of last hour}
      LLow(0),        {Low of last hour}
      tInit(FALSE);   {Flag to enable initialization}

if Date <> Date[1] then tInit = TRUE;   { Reset on a new day }

if Time = 1500 and tInit then begin
   tInit = FALSE;   { Disable after first 1500 bar }
   HHigh = High;    { Initialize values }
   LLow  = Low;
end;

if Time > 1500 and Time <= 1600 then begin
   HHigh = iff(High > HHigh, High, HHigh);  {Update values}
   LLow  = iff(Low  < LLow,  Low, LLow);
end;

Bob Fulks