PureBytes Links
Trading Reference Links
|
> Is there a way to calculate the high of the last X bars not
> including any bar that closes at 10:30? In other words I want to
> know the high for a period of time measured in 60 minute bars but
> do not want the opening bar for the day included in the
> calculation...
if Date <> Date[1]
then DayHigh = 0
else if High > DayHigh then DayHigh = High;
This code records the high *so far today* not counting the first bar
of the day. If you want it for an arbitrary period during the day
you'll have to fuss with it a bit more. For example, if you wanted
the high since 12:30, you could replace the first line with
if Time < 1230
DayHigh will be 0 until the 1230 bar, and after that it will record
the highest high of the day so far.
Gary
|