Announcement

Collapse
No announcement yet.

Cannot use object window of Javascript at EFS-File.

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

  • Cannot use object window of Javascript at EFS-File.

    Hello helper,

    I want to use the object window, because i want to call the method window.setTimeout().
    But the Javascript at EFS don`t know about window and i get a ReferenceError.

    Can anyone help me about this or in a different way to implement a sleep funtionality?

    thanx in advance,

    Torso

  • #2
    Hello Torso,

    The window object is a browser extension to the core JavaScript engine. That object is specific to client-side scripting for web development. Our EFS engine incorporates the core functionality of JavaScript 1.5 plus our custom EFS extensions. For a complete reference to our EFS extensions, please visit the EFS Help Center & Library. Please visit this link for a complete reference to Core JavaScript 1.5.

    EFS formulas execute on every tick and when ever a new bar starts. One option that you have for your timeout scenario would be to use the time of the bar to simulate a timer. The attached formula will give you an example of how to do this using a chart with a 1-minute interval. When the close crosses above a 20 period moving average, the formula sets a flag to true and colors the ma line yellow. This indicates your timeout periods. For each iteration of the formula, check the current bar time against the bar time when the time out started and turn the flag back to false if the length of the time out has passed. The attached formula uses a 3-minute timeout.

    If you need to drill down to seconds, you can use the same method but instead of using the EFS extensions that gives you the bar time, create a Date object and use the clock time.

    TimeOut.efs

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X