Announcement

Collapse
No announcement yet.

Can EFS execution be set to every second

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can EFS execution be set to every second

    Hi there,

    Is there some code I can use to force my EFS studies to execute every second rather that every tick - I can not use "compute on close" as the studues run on a multitude of timeframes from 1 min upwards and executing every minute or 15 mins does not meet the needs of the logic.

    Having multiple EFS studies executing every tick is placing too high a load on the system so I really need to slow them down if possible.

    I am running these applications on Forex charts as part of an automated trading strategy

    Thanks


  • #2
    Hello snapper,

    We don't have a method to force the formula to only execute on a set timer. Without using setComputeOnClose(), the formula will execute on each trade by default. However, you could prevent your code in main() from processing on each trade using getBarStateInterval(). Try adding the following line of code to the top of main().

    PHP Code:
    function main() {
        if (
    getBarStateInterval("1S") != BARSTATE_NEWBAR) return;



    The rest of your formula code should not require any changes. What the above will do is exit main on this line unless the 1S bar is at BARSTATE_NEWBAR. Your formula will still be executed on each trade but only allows the rest of your formula code to process once per second.
    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


    • #3
      Can EFS execution be set to every second

      Thanks Jason - I knew there would be a simple soulution. I'll try your suggestion.

      Comment


      • #4
        You're most welcome.
        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