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

Re: EZLanguage Q



PureBytes Links

Trading Reference Links

Max,

>I want to write an entry signal that uses one minute bars all day
>but also depends on the high from the previous day. If I use a
>Data1, daily and a Data2 one minute will I be able to get the

You don't need to do that.  Just use one minute bars, keep track of
the highest high and the lowest low each day, and save them in a
variable for use the following day, like so:

---------------------------------------------------------------------
vars: currenthigh(0), currentlow(0), hi(0), lo(0);

{initialize currenthigh and currentlow at the beginning of each day}

if time = Sess1StartTime then begin
   currenthigh = H;
   currentlow = L;
end;

{update currenthigh and currentlow during the day}

if time > Sess1StartTime and time <= Sess1EndTime then begin
   if H > currenthigh then currenthigh = H;
   if L < currentlow then currentlow = L;
end;

{save currenthigh and currentlow into hi and lo for tomorrow's use}

if time = Sess1EndTime then begin
   hi = currenthigh;
   lo = currentlow;
end;

{hi and lo will contain the previous day's values of high and low}
---------------------------------------------------------------------

This (untested) code should work on any intraday time frame.

-- 
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \ 
 // __)    Unicorn Research Corporation -- http://unicorn.us.com