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

Re: TS8 intrabarpersist



PureBytes Links

Trading Reference Links

Hi Chris,

Your code seems fine.

Does the second alert occur on every bar or just on some bars? Can you check to see the second alert (unexpected alert) is really at the close of the bar or at the opening of the next bar?

It is possible that you see H > HH[1] on one bar. And then on the very next bar, the open (which is also the high for the first tick of the bar) is higher than the prior bar. Then you would get alert again on the opening tick.

-- Harrison

------------------------------

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(l,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;