Functions
talib.change()
Compares the current source value to its value length bars ago and returns the difference.
Syntax · 1 of 3
talib.change(series int source, series int length) → series int
Arguments
source required series int Source series. length series int How far the past source value is offset from the current one, in bars. Optional. The default is 1. Return Type
series int Syntax · 2 of 3
talib.change(series float source, series int length) → series float
Arguments
source required series float Source series. length series int How far the past source value is offset from the current one, in bars. Optional. The default is 1. Return Type
series float Syntax · 3 of 3
talib.change(series bool source, series int length) → series bool
Arguments
source required series bool Source series. length series int How far the past source value is offset from the current one, in bars. Optional. The default is 1. 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)