Lipi Reference
Lipi

Functions

interval.change()

Returns true on the first bar of each new period of `interval`, for example on the first bar of every day when `interval` is "1D". Use it to reset values at the start of a larger period.

Syntax

                interval.change(series string interval) → series bool
              

Arguments

interval required series string

Return Type

series bool

Example


          //@lipi=2
indicator("interval.change Example", overlay=true)
static float dayHigh = na
if interval.change("1D") {
    dayHigh := high
} else {
    dayHigh := math.max(dayHigh, high)
}
plot(dayHigh, title="High of the Day", color=color.green)