[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

I use Time conditions like "Time < 1545" to keep my self from backtesting
entries toward the end of day. I see this time variable as changing with
your computer clock based upon the results I see. So, unless you plan on
stopping time I don't think your "currenttime" will ever equal "time". I
won't wait around until you succeed.  I'll try to be serious. It seems that
you are thinking that the bar begins with the first tick. It doesn't.

Because this code runs at the end of the bar you want to reset your
conditions at that point. You don't need to use a flag before your
condition, only after. Can't help you much more than that.




Jim Bronke
Phoenix, AZ



----- Original Message -----
From: "Jeff Meek" <jeff@xxxxxxxxxx>
To: "Thomas Alexander" <alexander_enterprises@xxxxxxxxx>; "Omega List"
<omega-list@xxxxxxxxxx>
Sent: Wednesday, July 11, 2001 10:20 PM
Subject: Re: Single alerts within a bar in realtime


> Thomas,
>
> I am trying to do the exact same thing...with no luck currently.  I want
to
> trigger an alert on the first tick inside a 1m bar where my condition is
> met.
> I tried something like this:
>
> var: currenttime(0),flag(0);
> If currenttime <> time then flag = 0;        {set flag to 0 on the first
> tick of the 1m bar}
> If condition and checkalert and flag = 0 then begin
>     Alert ("Foo");    flag = 1;        {set flag to 1 once the alert has
> triggered so it wont trigger again until the next bar}
> End;
> currenttime = time;
>
> Well, it didn't work.  So then I got to debugging and found that something
> was amiss in the way time was being handled.  Immediately after the
> Currenttime = time statement, I would Print(Currenttime, time).  You would
> expect the numbers to be the same, but they weren't.  Currenttime was the
> value of the current minute, but time would print the time when the
current
> bar was scheduled to complete.  I.e. at 10:13:55, the time function would
> print 1014.  So if that's the case, why didn't Currenttime = time set the
> Currenttime variable to 1014 also?!?  Throughout every tick in the bar,
> despite many Currenttime = time commands, printing Currenttime and time
> returned different results.  At that point, I got pissed off and went to
> work on something else :-)
>
> Does someone on the list have some insight into the way TS2k or EL uses
the
> time function?
>
> -Jeff
>
> ----- Original Message -----
> From: "Thomas Alexander" <alexander_enterprises@xxxxxxxxx>
> To: "Omega List" <omega-list@xxxxxxxxxx>
> Sent: Wednesday, July 11, 2001 5:07 PM
> Subject: Single alerts within a bar in realtime
>
>
> > Good evening happy traders!
> >
> > I tried about two years ago to code an alert that would
> > only trigger once in a bar on a real-time chart. What seems
> > to happen is that the alert, once triggered, is retriggered
> > for every tick after that in the bar. You can set single
> > real-time alerts well enough in Radar Screen. But the last
> > I heard from Omega was that to do it in a chart you needed
> > some kind of third-party global routine to do it in a
> > chart.
> >
> > Has anyone come up with a workaround or clever method?
> >
> > May all your ticks be golden.
> > ta
> >
>
>