CountedBars
Syntax
Counted_bars(): numberParameters
Return Value
Description
Example
// Get the number of already calculated bars
const counted = this.api.Counted_bars()
// Use it to optimize calculations
const total = this.api.Bars()
const limit = counted > 0 ? total - counted : total - 1
// Only calculate for new bars
for (let i = limit; i >= 0; i--) {
// Perform indicator calculations for bar at index i
}Last updated