Lipi Reference Lipi

Functions

talib.variance()

Variance is the expectation of the squared deviation of a series from its mean (ta.sma), and it informally measures how far a set of numbers are spread out from their mean.

Syntax

                talib.variance(series float source, series int length, series bool biased) → series float
              

Arguments

source required series float Series of values to process.
length required series int Number of bars (length).
biased series bool Determines which estimate should be used. Optional. The default is true.

Return Type

series float

Example


          indicator("Variance Indicator", overlay=false)
length = input(20, "Variance Length")
varianceValue = talib.variance(close, length)
plot(varianceValue, color=color.blue, title="Variance")