DevSqrd (Function)
The DevSqrd function calculates the sum of squares of deviations of a price from the average.
The calculation of this formula is similar to the classic statistical volatility (Statistical Standard Deviation), the difference being that peaks (higher values) are accentuated because the values are squared.
Syntax
DevSqrd(Price,Length)
Returns (Double)
A numeric value for the current bar.
Parameters
|
Name |
Type |
Description |
|
Price |
Numeric |
Specifies which bar value (price, function, or formula) to use. |
|
Length |
Numeric |
Sets the number of trailing bars to consider for the calculation. |
Remarks
The input parameter Price can be a bar value such as Close, High, Low, Open, or Volume. It can also be any mathematical calculation such as High + Low) / 2, or a numeric function such as RSI, Stochastic, or ADX.
The value for the Length input parameter should always be a whole number greater than 0.
Example
Assigns to Value1 the DevSqrd value for the Close looking at the 14 bar average of the Close, then plots Value1:
Value1 = DevSqrd(Close, 14);
Plot1(Value1, "DevSqrd");