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

Re: Single alerts within a bar in realtime



PureBytes Links

Trading Reference Links

Stuart is correct in that if you are plotting a paintbar you really want the
bar to be painted while the condition is true, and then to become unpainted
when the condition becomes false. Same thing applies to ShowMe studies.

You can effectively achieve this effect on paintbars with the following code
(as long as you don't paint the bars too thick) which shows the alert once
per bar but paints and unpaints throughout the bar: (You do get a residual
dot on the close from this method, depending on the thickness you use).

{-------------------------------------}
{PaintBar Code for "Any PaintBar"}
Input: Cond(True), Symbol(1200);

 if Cond then begin
  Plot1(High, "High");
  Plot2(Low, "Low");
  if CheckAlert And DoOnce(Symbol) Then Alert = True;
 end;

 if Cond = False then begin
  Plot1(C, "High");
  Plot2(C, "Low");
 end;
{-------------------------------------}

Doing the same thing on ShowMe studies is a bit trickier since you can't
compress the ShowMe dot as effectively as the Paintbar. A long while ago I
made an indicator that acted as a ShowMe. By manually scaling the chart and
setting the plot value = 0 (or just outside the plotted range on the chart)
when it is not true you get the same effect. The drawback of that particular
solution is that you have to manually scale your chart for it to work
correctly.

Patrick White

----- Original Message -----
From: "Stuart A. Miller" <spooz2@xxxxxxxxxxxxx>
To: "Patrick White" <simgenie@xxxxxxxxx>; "Omega List"
<omega-list@xxxxxxxxxx>
Sent: Thursday, July 12, 2001 1:59 PM
Subject: Re: Single alerts within a bar in realtime


I don't know if the solutions offered so far solve the "alert once" problem
in all respects.