StdDevS (Function)
The StdDevS function calculates a standard deviation for a sample of values.
Syntax
StdDevS(Price, Length)
Returns (Double)
A numeric value containing the sample standard deviation value of the specified bar.
Parameters
Name |
Type |
Description |
Price |
Numeric |
Specifies the price information to be considered. |
Length |
Numeric |
Indicates the length of time (in bars) to be considered. |
Usage
This function returns a value representing how widely dispersed individual (Price) values are away from the mean average (using the same inputs) of a sample. To find the standard deviation, first find the variance of a sample and then take its square root.
Example
Assigns to Value1 the sample standard deviation of closing prices over the last 21 bars:
Value1 = StdDevS(Close, 21);
Assigns to Value2 the sample standard deviation of a 14 bar moving average of the High, calculated over the last 10 bars.
Value2 = StdDevS(Average(High, 14), 10);