WMA 7 20 50 Stack (Trend)
Buys when the 7/20/50 weighted moving averages stack bullishly — fast above mid above slow — and sells when the fast average drops back below the mid.
How It Works
- Compute three weighted moving averages over 7, 20 and 50 bars.
- Buy when they stack bullishly — fast above mid above slow. The 7-bar leader makes this the fastest of the stack strategies: earlier entries, at the cost of more false starts.
- Sell when the fast average drops back below the mid.
Worked example. WMA7 = 104.0 overtakes WMA20 = 103.4 while WMA20 already sits above WMA50 = 102.1 — the stack is aligned, so buy. When WMA7 later dips under WMA20, the position closes.
The Math Behind The Indicators
Everything runs on closing prices of the traded timeframe: P is a close, Pt today's close, and N counts bars — one bar is one candle of that timeframe, so 20 bars on a 1h chart is 20 hours.
- Weighted Moving Average (WMA)
- A moving average where newer prices count more: the latest close gets weight N, the one before N − 1, down to weight 1 for the oldest. That makes it react to a turn in price sooner than a plain average.
- \[\mathrm{WMA}_N = \dfrac{N \cdot P_t + (N-1) \cdot P_{t-1} + \cdots + 1 \cdot P_{t-N+1}}{N + (N-1) + \cdots + 1}\]
- Example: With N = 3 and closes 100, 102, 104 (oldest to newest): (1·100 + 2·102 + 3·104) / (1 + 2 + 3) = 616 / 6 ≈ 102.67 — pulled closer to the latest price than the plain average of 102.