WMA¶
Indicators · Moving Averages
Weighted Moving Average — linearly weighted toward the latest bar.
The WMA is a moving average that cares more about now than then. Instead of weighting every bar in the window equally, it puts the heaviest weight on the most recent bar and tapers down linearly to the oldest. The result is a trend line that hugs price more tightly than an SMA and turns sooner after a real move — without the recursive "memory" tail that an EMA drags behind it.
How it works¶
For a Period of N, the WMA multiplies the newest bar by N, the previous by N−1, and so on down to ×1 for the oldest, then divides by the sum of those weights (N + (N−1) + … + 1). Because the weights are a straight ramp, recent price dominates: the line is more responsive than an SMA of the same length but smoother and less spike-prone than you might fear.
The Source defaults to close but can be any single price (open, high, low) or a blend (hl2, hlc3, ohlc4); feed a series in through the input and the WMA weights that instead. The one output is a value per bar, drawn as a line you colour with Line color.
When to use it¶
Use the WMA when you want something faster than an SMA but more predictable than an EMA — it sits neatly between the two in responsiveness. It's a solid middle-ground trend line for swing systems and a clean input to crossover logic. In choppy ranges it will still whip you around (every fast average does), so pair it with a regime filter rather than trading its crosses naked.
Example¶
Swap a WMA in wherever you'd reach for an SMA but want a quicker turn. Wire bars into a Period 20 WMA and a Period 50 WMA, feed both to a Crosses Above for the entry trigger, and route to a Buy Signal. Confirm the regime with ADX / DMI so you only act when there's a real trend to ride, then backtest in the Tester.
Tips & gotchas¶
- Faster than SMA, smoother than EMA. That's the niche. If you need maximum responsiveness, an EMA or HMA reacts even quicker; if you need maximum smoothness, the SMA wins.
- Linear, not exponential. The oldest bar drops out cleanly at the window edge — there's no infinite tail, so a single old outlier can't haunt the line forever.
- Keep sources consistent across any two WMAs you compare, or the crossover means nothing.
- Don't over-tune the period. 19 vs 21 is noise; 20 vs 200 is a different strategy. Chasing the exact best number on past data is curve-fitting.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| Source | bars / series |
Price bars or any indicator series |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| WMA | series |
Line | Weighted moving average of source |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| Period | number · 2–500 | 20 |
|
| Source | choice (close, open, high, low, hl2, hlc3, ohlc4) |
close |
|
| Line color | colour | #ba68c8 |
Reference auto-generated from the block catalog · category Indicators.