WMA 20 50 Crossover (Trend)
Buys when the 20-bar weighted moving average crosses above the 50-bar and sells when it crosses back below.
How It Works
- Compute two weighted moving averages of the close: a fast one over 20 bars and a slow one over 50.
- Buy when the fast WMA crosses above the slow one — recent prices are rising faster than the longer trend, suggesting an uptrend is starting.
- Sell when the fast WMA crosses back below the slow one — the short-term push has faded beneath the longer trend.
Worked example. Yesterday WMA20 = 101.4 sat below WMA50 = 101.6; today they print 101.9 and 101.7 — the fast average has crossed above the slow one, so buy. Weeks later the fast average rolls back under the slow one and the position is sold.
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.
- 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.