array.stdev() - Pine Script Function
array.stdev()
Section titled “array.stdev()”Overview
Section titled “Overview”The function returns the standard deviation of an array’s elements.
Syntax
Section titled “Syntax”array.stdev(id, biased) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | array<int/float> | An array object. |
Returns
Section titled “Returns”The standard deviation of the array’s elements.
Remarks
Section titled “Remarks”- If biased is true, the function calculates using a biased estimate of the entire population. If biased is false, it uses an unbiased estimate of a sample.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("array.stdev example")a = array.new_float(0)for i = 0 to 9array.push(a, close[i])plot(array.stdev(a))