Announcement

Collapse
No announcement yet.

Is it possible to 'wrap' a section of code processing using setComputeOnClose()

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

  • Is it possible to 'wrap' a section of code processing using setComputeOnClose()

    Is it possible to 'wrap' a piece of efs code processing...to combine a procedure with the function call setComputeOnClose() such that the procedure (i.e. computeMAs()) is called only once (on the close)?

    This would be a strategy to combine code you want to process every tick with code you want to compute only on the close...much like an event procedure in Visual Basic.

    Can I use the event function call setComputeOnClose() to call a subprocedure buried in the script after the main() procedure has finished?

    ***Would it be possible to combine two efs scripts into one study...one oscillator...i.e. one that computes on every tick and one that computes on the close???

    Any help is much appreciated,

    gg
    Last edited by gguindon; 09-17-2009, 09:46 AM.

  • #2
    Re: Is it possible to 'wrap' a section of code processing using setComputeOnClose()

    gg
    You would not be able to use setComputeOnClose() because it applies to the entire script.
    What you need to do is enclose inside a BARSTATE_NEWBAR condition the section(s) of code that you want to execute only at each new bar
    If you search the forums you will find hundreds of examples on how to do this as the subject has been covered at length before
    Alex


    Originally posted by gguindon
    Is it possible to 'wrap' a piece of efs code processing...to combine a procedure with the function call setComputeOnClose() such that the procedure (i.e. computeMAs()) is called only once (on the close)?

    This would be a strategy to combine code you want to process every tick with code you want to compute only on the close...much like an event procedure in Visual Basic.

    Can I use the event function call setComputeOnClose() to call a subprocedure buried in the script after the main() procedure has finished?

    ***Would it be possible to combine two efs scripts into one study...one oscillator...i.e. one that computes on every tick and one that computes on the close???

    Any help is much appreciated,

    gg

    Comment

    Working...
    X