# Standard Deviation

Standard deviation measures the volatility of a market instrument. It does this by comparing the actual value in an interval to its simple moving average (SMA). The price becomes more volatile as these grow further apart.

Standard deviations are not normally used by themselves; instead they are used to calculate other indicators, such as Bollinger bands.

#### Calculation

The standard deviation for an interval is actually calculated using data from several intervals:
• For each interval, the difference between the value and the SMA is calculated and squared
• The results are added together
• The square root is taken and is then divided by the number of intervals

The example below shows how the standard deviation of a closing price is calculated.

VAL( J ) = ( CLOSE( J ) – SMA( CLOSE( J ), N ) ) ^ 2

StdDev = SQRT( SUM ( VAL( J ), N ) ) / N

VAL is the square of the difference between the indicator value and the SMA

J is the interval number

N is the number of intervals used

You can find more information about technical indicators in the MetaTrader 4 User Guide. Select Help > Help Topics > Analytics > Technical Indicators.