Functions
talib.change()
The difference between the current value of `source` and its value `length` bars back. Three overloads exist, one each for an int, a float and a bool source, and the returned type follows the source you pass. `length` is optional in all three.
Syntax · 1 of 3
talib.change(series int source, series int length) → series int
Arguments
source required series int The series to compare against its own past. Int, float and bool sources each have their own overload. length series int Optional. How far back the comparison reaches. Return Type
series int Syntax · 2 of 3
talib.change(series float source, series int length) → series float
Arguments
source required series float The series to compare against its own past. Int, float and bool sources each have their own overload. length series int Optional. How far back the comparison reaches. Return Type
series float Syntax · 3 of 3
talib.change(series bool source, series int length) → series bool
Arguments
source required series bool The series to compare against its own past. Int, float and bool sources each have their own overload. length series int Optional. How far back the comparison reaches. Return Type
series bool Example
indicator("Price Change", overlay=false)
// User input for change period
length = input(1, title="Change Period")
// Calculate price change
priceChange = talib.change(close, length)
// Plot price change
plot(priceChange, title="Price Change", color=color.blue, linewidth=2, style=plotStyle.histogram)