A six-bar calculation with different crossover dates
This is a hypothetical arithmetic example, not a market backtest. Closes for bars 1 through 6 are 100, 102, 101, 104, 102, 105. Volumes in arbitrary but consistent units are 10, 10, 100, 10, 100, 10. Use fast 2, slow 3, and signal 2 to keep the calculation short; these are not recommended trading settings.
Seed both price EMAs at 100 on bar 1, so standard MACD and its initial signal are zero. For every EMA, alpha = 2 / (length + 1), and the next value is alpha × current input + (1 − alpha) × previous EMA. The weighted line first exists on bar 3; seed its signal with that first value. Each method then applies a 2-bar EMA to its own line.
For confirmation, divide current volume by the mean of the previous two bars, excluding the current bar, and require a ratio strictly greater than 1. All values below are rounded to four decimals after calculation. Both methods use the same closing prices and bar-close timing.
- Bar 3: VWMA(2) = 101.0909 and VWMA(3) = 101.0000, so W = 0.0909; weighted signal = 0.0909. Standard M = 0.1111 and signal = 0.1481. Relative volume = 10.0000. The weighted signal is only initialized; no weighted crossover can be inferred without a valid previous value.
- Bar 4: VWMA(2) = 101.2727 and VWMA(3) = 101.3333, so W = −0.0606; weighted signal = −0.0101. Standard M = 0.5370 and signal = 0.4074, a bullish crossover. Relative volume = 10 / 55 = 0.1818, so the confirmation version rejects that event.
- Bar 5: VWMA(2) = 102.1818 and VWMA(3) = 101.6190, so W = 0.5628; weighted signal = 0.3718, a bullish crossover. Standard M = 0.0957 and signal = 0.1996, a bearish crossover. Relative volume = 100 / 55 = 1.8182. Passing the volume filter cannot turn a bearish MACD event into a bullish one.
- Bar 6: VWMA(2) = 102.2727 and VWMA(3) = 102.4167, so W = −0.1439; weighted signal = 0.0280. Standard M = 0.4902 and signal = 0.3933, another bullish crossover. Relative volume = 0.1818, so it is rejected again. Volume weighting and confirmation have produced different event sequences.