Skip to main content

change

Syntax Format​

change(series, n=1)

Overview​

The change function calculates the difference between the current series values and the series values over the chosen offset value from the current bar. You can use this function in scripts to analyze the change volume of the asset price over the chosen period. The function returns the series - series[n].

Parameters​

ParameterTypePurposeDefault State
seriesseriesInput series
nintegerOffset from the current bar1

Returns: series.

Example​

change_data = change(close, 14) -- calculating the 14-period closing prices change