Lipi Reference
Lipi

Functions

talib.variance()

Variance of `source` over `length` bars. An optional `biased` flag chooses between the biased and unbiased forms of the calculation. `talib.stdev` has no such flag.

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


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