PureBytes Links
Trading Reference Links
|
Mitch, I see what you're trying to do. You want the day to finish, and
then bracket the intraday price chart between two lines representing the
high and low for that same day.
>http://www.lbrgroup.com/pics/charts/seen/1059048608.png (look at
>the image on the right). Any ideas?
I'd do it with trendlines, myself. Like this:
----------------------------------------------------------------------
vars: currenthi(-99999), currentlo(999999), TLH(-1), TLL(-1);
if H > currenthi then currenthi = H; {current day's high}
if L < currentlo then currentlo = L; {current day's low}
if TLH < 0 then
TLH = TL_New(date, Sess1StartTime, currenthi, date, time, currenthi);
else begin {update high horizontal line position}
TL_SetBegin(TLH, date, Sess1StartTime, currenthi, date, time, currenthi);
TL_SetEnd(TLH, date, Sess1StartTime, currenthi, date, time, currenthi);
end;
if TLL < 0 then
TLL = TL_NEW(date, Sess1StartTime, currentlo, date, time, currentlo);
else begin {update low horizontal line position}
TL_SetBegin(TLL, date, Sess1StartTime, currentlo, date, time, currentlo);
TL_SetEnd(TLL, date, Sess1StartTime, currentlo, date, time, currentlo);
end;
if time >= Sess1EndTime then begin {last bar of the day}
TLH = -1; {reset so next day's trendline will be drawn}
TLL = -1; {reset so next day's trendline will be drawn}
currenthi = -999999; {reset to get next day's high}
currentlo = 999999; {reset to get next day's low}
end;
----------------------------------------------------------------------
The above should leave horizontal trendlines across all the days, and on
the current day the horizontal lines should update their positions in
real time.
The above code is untested, written from my heaad.
-Alex
|