Moving average
Any of the eight moving averages, chosen by name.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 14 | 1 to 5000 |
| method | ma_method | sma |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| ma | value | Optional | color theme.accent, style line, width 1 |
- Warm-up
- pick(method, {'sma': period - 1, 'ema': period - 1, 'smma': period - 1, 'lwma': period - 1, 'wma': period - 1, 'hma': period + round_half_up(sqrt(period)) - 2, 'dema': 2 * period - 2, 'tema': 3 * period - 3}) bars (13 at the defaults)
- Repaints
- No
- Parity
- TA-Lib, within 1e-9
Formula
MA = the average named by method: sma, ema, smma, lwma, wma, hma, dema or tema.
Each one follows its own formula and warm-up.