Syntax
Public Function StandardDeviation(chart_id As Long, applyTo As ENUM_APPLIED_PRICE, period As Integer, StandardDev As Double, Ma As ENUM_MA_METHOD) As String
Description
Standard deviation is a statistical term that measures the amount of variability or dispersion around an average.
Generally speaking, dispersion is the difference between the actual value and the average value. The larger this dispersion or variability is, the higher the standard deviation. The smaller this dispersion or variability is, the lower the standard deviation.
Chartists can use the standard deviation to measure expected risk and determine the significance of certain price movements.
Parameters
Key | Description |
chart_id | Chart identifier, 0 is the current chart ,value of type Long |
applyTo | Applied price , can be one of theENUM_APPLIED_PRICE |
period | The calculation period, on which the indicator will be calculated, value of type Integer |
StandardDev | Standard deviation period , value of type Double. |
Ma | Moving average to be used on calculation , can be one of theENUM_MA_METHOD |
Return value
Returns the handles of a technical indicator, in case of failure returns an empty string.
Sample
Public Sub main()AlertMessage (StandardDeviation(0, PRICE_CLOSE, 14, 3, MODE_SMA))'Draws the indicator on chart and shows a message box with the indicator name.End Sub
See Also