Math.standardDeviation
The standard deviation of a list of numbers: the square root of the variance. Cloud9Trader adds it to JavaScript’s built-in Math.
standardDeviation(x: number[]): number;Parameters
Section titled “Parameters”- x: an array of numbers, such as the result of
prices().
The population standard deviation, as Bollinger Bands use. The standardDeviation() indicator is a different thing: it works out the standard deviation of closes for you.
Errors
Section titled “Errors”Stops the run if x is not an array: “Value passed to Math.standardDeviation() must be an array of numbers”.
Example
Section titled “Example”function onIntervalClose() { log("standardDeviation", Math.standardDeviation(prices(20)));}