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

Re: Lowest Low Question



PureBytes Links

Trading Reference Links

     
You could do something like this -- LoLow and HiHigh will always have the
Highest High and Lowest Low for the specified time period.  The Variables
are reset for each new day.         
The "Tm" and "Dt" references for Date and Time are necessary due to bugs in
the TS Date and Time functions.  You can adjust the basic logic depending on
what you're trying to do.

--------------------------------------------
Vars: Tm(0), Dt(0), LoLow(99999), HiHigh(0);

Tm=Time; Dt=Date;

If Dt <> Dt[1] then Begin
  LoLow=99999; HiHigh=0;
End;

If Tm > 1014 and Tm < 1216 then Begin
  If High > HiHigh then HiHigh = High;
  If Low < LoLow then LoLow = Low;
End;
----------------------------------------------

At 05:15 pm 1/25/98 -0500, you wrote:
>I'm writing some code on a 5 min S&P chart and have a question ...
>
>At 10:15am I've captured the value of the highest high that occurred
>between 9:45am and 10:15am (e.g. 'SimHigh' = 967.50):
>
>For every 5 min bar between 10:15am and 12:15am, I want to check for the
>following:
>*  The lowest low since 10:15 only (ingoring any lows pre-10:15)
>*  Is this lowest low <=Simhigh-300 points?
>
>To avoid writing out 24 times (!!):
>if t=10:15 ...
>if t=10:20 ...
>..etc.
>
>is there anyway I can do this via a loop or something similar??
>My problem is that the length in the lowest(price,length) function is going
>to change with each bar between 10:15 and 12:15.
>
>Any suggestions from anyone with a better programming brain than myself
>will be greatly appreciated!
>
>Simon.
>
>
>