PureBytes Links
Trading Reference Links
|
Take a look at the code for the "OneAlert" function to see how to fix it. They test if CurrentBar has advanced:
inputs:
Criteria( truefalsesimple ) ;
variables:
intrabarpersist AlertBar( -1 ) ;
if Criteria and AlertBar <> CurrentBar then
begin
OneAlert = true ;
AlertBar = CurrentBar ;
end
else
OneAlert = false ;
Isn't the new IntraBarPersist feature great!
Bob Fulks
At 12:23 AM 12/11/2005, Chris Cheatham wrote:
>Any TS8 wizards out there? I'm suck on the alert code below. Using intrabar
>persist to have alert sound only once, the first time in bar that condition
>is true. It does that, but also alert sounds at the end of the bar when a
>"real" alert is triggered when it seems it shouldn't. I know I must be
>missing something dumb, but I still haven't found it a week later. Any
>ideas?
>
>Thanks,
>Chris
>
>p.s., intraday 4 min chart, indicator is for $tick which is data6 on the
>chart. indicator is "based on" data6.
>
>
>
>
>variables: LL(0), HH(0), intrabarpersist Htick(0),
> intrabarpersist Ltick(0), Length1(20) ;
>
>if barstatus(6) = 2 then begin
> LL = Lowest(L, Length1 );
> HH = Highest(H, Length1 );
> if H > HH[1] then begin
> plot5(H, "Hup");
> plot6(maxlist(H, HH[1]), "Lup");
> end;
> if L < LL[1] then begin
> plot7(minlist(LL[1], H), "Hdn");
> plot8(L, "Ldn");
> end;
> Htick = 0;
> Ltick = 0;
>end else begin
> if H > HH[1] then begin
> if Htick = 0 then alert("tick");
> Htick = 1;
> plot5(H, "Hup");
> plot6(maxlist(L, HH[1]), "Lup");
> end;
> if L<LL[1] then begin
> if Ltick = 0 then alert("tick");
> Ltick = 1;
> plot7(minlist(LL[1],H), "Hdn");
> plot8(L,"Ldn");
> end;
>end;
|