Announcement

Collapse
No announcement yet.

Calculations start only on the last bar

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

  • Calculations start only on the last bar

    Hello,

    I tried getBarState=Barstate_currentbar and islastbaronchart but still does not work.

    I just want the indicator to calculate on the last bar.

    -Mike

  • #2
    I have several scripts that work on the last bar, but I have to write an efs to handle the calculations. If you check for BARSTATE_NEWBAR, and start your calculations when that condition occurs, you can get what you need, I believe.

    On each subsequent BARSTATE_NEWBAR, you just restart all your calculations, zero out the accumulation variables, etc.

    Hope this helps. Good luck to you.

    Comment

    Working...
    X