PureBytes Links
Trading Reference Links
|
On Wed, 15 May 2002, Jerry War wrote:
> I have written some code for an intraday indicator that triggers off time.
> Since I only wanted to execute the code once I added a variable that was set
> true at the start of the day and then set false during the code triggered by
> time. Something like this.
>
> If day<>day[1] Then
> TimeFlag=True;
>
> If time>1400 and TimeFlag then
> Begin
> do this
> do that
> TimeFlag=False;
> End;
>
> Except that what I see happening with update every tick is on, Is that the
> variable TimeFlag does not get permanently set False
> until The current bar closes. Such that, the do this do that, happens
> multiple times until the bar closes. I would think that with update every
> tick on the variables should update every tick. Not on the bar close. I have
> confirmed this is what is happening by
> writing the variable to a temp file. Is this correct or am I miss
> understanding something. This is TS6 if that makes a difference.
>
> Regards
> Jerry
>
vars: TimeFlag(false);
TimeFlag = false;
If day <> day[1] then
TimeFlag = true;
If time > 1400 and TimeFlag then begin
end;
Would a better way be:
vars: TimeFlag(true);
if time > 1400 and TimeFlag then begin
TimeFlag = false;
end;
Mike
|