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

Re: Starting and indicator at a specific time???????????


  • To: RGHSTOCKS@xxxxxxx
  • Subject: Re: Starting and indicator at a specific time???????????
  • From: "Gary Fritz" <fritz@xxxxxxxx>
  • Date: Mon, 08 May 2006 06:30:07 -0600
  • Priority: normal

PureBytes Links

Trading Reference Links

> Inputs: BeginTime(1000);
> Vars: LastHH(0);
> if Date  <> Date[1] and Time >= BeginTime then begin
> LastHH  = High;    
> end;
> 
> If High > LastHH then LastHH = High  else LastHH = LastHH ;
> Plot1( LastHH, "LastHH" ) ;  

Date<>Date[1] is true only on the FIRST bar of the day.  
Time>=BeginTime is true only at or after 10:00.  Your first if will 
never succeed unless the first bar happens at or after 10:00.  You 
don't want both of those tests in the same if.

Change the first bar to "if Date<>Date[1] then LastHH = 0;".  Then 
change the second if to "if Time >= BeginTime and High > LastHH then 
LastHH = High;".  The "else LastHH = LastHH" is unnecessary -- you're 
just setting it to the value it already has.

Gary