VariancePS (Function)
The VariancePS function calculates the estimated variance based either on the population or a sample.
Syntax
VariancePS(Price, Length, DataType)
Parameters
|
Name |
Type |
Description |
|
Price |
Numeric |
Specifies which bar value (price, function, or formula) to consider. |
|
Length |
Numeric |
Sets the number of trailing bars to consider. |
|
DataType |
Numeric |
Sets the data type. 1 = population, 2 = sample |
Returns (Double)
A numeric value containing the estimated variance for a set of values over length bars.
Remarks
Variance is the measure of the "scatter" of prices around the mean of a sample.
Example
Assigns to Value1 the Variance calculated over the past 14 closing prices.
Value1 = VariancePS(Close, 14, 1);
Assigns to Value2 the sample Variance calculated over the past 21 High prices.
Value2 = VariancePS(High, 21, 2)