Linear weighted moving average
Average that weights the newest value N times and the oldest once.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 13 | 1 to 5000 |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| wma | value | Optional | color theme.accent, style line, width 1 |
- Warm-up
- period - 1 bars (12 at the defaults)
- Repaints
- No
- Parity
- TA-Lib, within 1e-9
Formula
WMA[i] = (period * x[i] + (period - 1) * x[i-1] + ... + 1 * x[i-period+1]) / (period * (period + 1) / 2)
No value until period bars exist. A window holding a missing value has no value.