Skip to content
Algo Trade Analytics Docs

ta.variance() - Pine Script Function

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.

ta.variance(source, length, biased) → series float
NameTypeDescription
sourceseries int/floatSeries of values to process.

Variance of source for length bars back.

  • If biased is true, function will calculate using a biased estimate of the entire population, if false - unbiased estimate of a sample.