Announcement

Collapse
No announcement yet.

setComputeOnClose and performance

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

  • setComputeOnClose and performance

    Hi,

    if I use setComputeOnClose will that mean the EFS runs only once each time a bar closes and that because of that CPU will be working less?

    In other words: using it will improve performance, correct?

    Thanks

  • #2
    Yes.

    If you have scripts which don't need to analyze every tick coming in, then always use setComputeOnClose() in the preMain().

    If you have a hybrid type of script where you look at each tick in some places and other places you only need to do some analysis as a new bar comes in then put this guard code around it:

    PHP Code:
    if (getBarState() == BARSTATE_NEWBAR)
    {
        
    // your newbar code goes here

    Comment


    • #3
      Thank you, I'm glad that's true because I've had a few pages open and I notice my CPU slowing down. This should make my indicators much more useful.

      Comment

      Working...
      X