[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

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
>