# Standard deviation

`stdev`

How far values spread around their average over a period.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| source | source | close |  |
| period | int | 20 | 1 to 5000 |
| method | ma_method | sma |  |

## Outputs

| Name | Kind |
| --- | --- |
| stdev | value |

Warm-up: period - 1 bars (19 at the defaults).

Repaints: No.

## Formula

The square root of the mean squared distance of the last period values from the chosen average at the current bar

The divisor is period, not period - 1.
