Announcement

Collapse
No announcement yet.

Need delay!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need delay!!!

    Been beating my brain up here. What is the best way to insert a 10 second delay in a script? I need to delay and wait for an event before I can proceed to the next one. Thanks.. Much appreicated!
    Last edited by glay; 05-01-2007, 11:59 AM.

  • #2
    I'll let a more experienced user give you a definitive answer, but I don't think it's possible to delay a script. It's my understanding that eSignal starts the script at main(), and that's the only place.

    To do what you want, you'll need to set a static variable that says "wait for event", then return from main. When main is invoked again, check the variable to see if you're waiting for the event, if so check the event, if still hasn't happened, return and check it again on the next invocation.

    This should work fine as long as your event is market driven.

    Comment


    • #3
      Thanks! I'm working on a few different ways. Right now just using a second counter.

      Comment


      • #4
        OK. Don't try delaying the script internally for 10 seconds; eSignal waits for the script to finish before updating the chart, and it will be unresponsive until then.

        Comment


        • #5
          you cant..

          All the efs scripts run with "each tick". So you can't drop the efs script into a "while" loop to "wait" for something.

          You have to record the TIME of the event (see the efs time functions). Once you record the time (I usually record this in seconds), then you can create a delay.

          if ((recordedevent+delay_time) >= Current_RTTime) {
          ..then we can trigger the next phase.

          }

          I use this type of stuff all the time and it works.
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment

          Working...
          X