PureBytes Links
Trading Reference Links
|
>I've got a bug that shows up running real-time that doesn't show when
>applied to historical data. The code simply plots the previous day's High
>and Low on the current day.
>
>if date <> date[1] then begin
This may give you different results depending on which time zone
you're in, because the statement will be true only after midnight --
which is different for each time zone. What you should do instead
is:
if time crosses over Sess1EndTime then begin
Better yet, if you just want the high and low of the day session, your
first if statement should be split up as follows. The whole indicator
becomes:
if time crosses over Sess1EndTime then begin
prevDH = currentDH;
prevDL = currentDL;
end;
if time = Sess1FirstBarTime then begin
currentDH = H;
currentDL = L;
end;
if H > currentDH then currentDH = H;
if L < currentDL then currentDL = L;
plot1(prevDH, "prevDH");
plot2(prevDL, "prevDL");
Changing your triggers from date changes to time crossovers *might*
fix your problem. I use something similar to this and it works fine
for me.
--
,|___ Alex Matulich -- alex@xxxxxxxxxxxxxx
// +__> Director of Research and Development
// \
// __) Unicorn Research Corporation -- http://unicorn.us.com
|