Re: Issues with running two timers at the same time by FamilyTreeMike
FamilyTreeMike
Fri May 09 13:44:32 CDT 2008
It sounds like you could do with just one timer, setting the initial stock
price if this is the first timer event after 9:30am and setting the current
if it is later.
Do you have separate event handler code for each timer?
"Curious" wrote:
> On May 9, 12:01 pm, Family Tree Mike
> <FamilyTreeM...@discussions.microsoft.com> wrote:
> >>>> What do you mean when you say the first timer doesn't do what it should do?
>
> The first timer grabs the opening prices of a selected set of stock
> symbols. For instance, if the opening price of IBM is $125 and the
> opening trade happens at 9:31:00 AM, the first timer should grab this
> price ($125) for IBM at 9:31:00 AM.
>
> Then the second timer is launched. I noticed that the first timer is
> not able to grab the opening prices any more, although there are a lot
> of opening trades happening. It feels like that the second timer blows
> off the first timer.
>
> >>>> Is it possible the two handlers are running into a conflict in your code?
>
> I don't think so. The first timer grabs the open before the open. Once
> open, it grabs the open and that's when its mission is over.
>
> The second timer is a post-open checker. It checks subsequent trades
> after the open. So there's no conflict between the two.
>
> > If you stopped the timer, you would need a way to start it again
>
> Why? If I only want a timer to run for two hours, is there a way to
> add this as additional parameter? There may be side effect to let a
> timer run for a prolonged period of time when you don't really need
> it. It exhausts the system resources.
>
> Thanks,
>