Skip to main content
Track MACD
11 / 80
Library

1994issue C021-3

Seeding DEMA2 filters to build a MACD signal

A MACD signal is assembled only after two DEMA2 filters are fully specified. Each filter takes its alpha and beta from a conventional lookback, starts from a regression-seed of weekly closes, and keeps the level-component and slope-component updates separate.

  • DEMA2 is a two-parameter filter. Its alpha and beta constants are taken from the conventional 26-period and 12-period MACD lookbacks.
  • Each filter starts from a regression-seed of weekly closes on time. The intercept seeds the level-component and the slope seeds the slope-component.
  • After that start, the level-component mixes the newest close with the prior level plus prior slope. The slope-component updates from the change in successive levels.
  • The macd-line is the 12-week DEMA2 filter minus the 26-week DEMA2 filter. The signal-average is a nine-period exponential smooth that places a 0.2 weight on the newest MACD value.
Entries in this reading3 entries

The archive sequence builds a MACD signal from two already specified DEMA2 filters. DEMA2 is a two-parameter smoother that updates a level with one constant and a companion slope with a second constant. The sequence sets those constants, starts each filter from a regression-seed, and keeps the level-component and slope-component updates separate. The macd-line is formed only after those filters are fully specified.

Set alpha and beta from the MACD lookbacks

DEMA2 is specified as a two-parameter filter controlled by a pair of smoothing constants, alpha and beta. Those constants are set from the conventional MACD lookbacks of 26 periods and 12 periods.

For the 26-period constants, alpha is 2/(26+1) and beta is 2/((0.5*26)+1). The 12-period pair uses the same two formulas with 12 in place of 26. Alpha is the primary smoothing weight taken from a chosen lookback as two divided by one plus that lookback. Beta is the secondary smoothing weight taken from half the same lookback.

Start each filter from a regression-seed

Each filter is started from a linear regression of weekly closing prices on time. The slow filter uses a 26-week fit and the fast filter uses a 12-week fit. That regression-seed is a linear fit of weekly closes on time used only to start the level and slope.

The level series is seeded with the regression intercept. The companion slope series is seeded with the regression slope.

Keep the level-component and slope-component separate

After seeding, the level-component is a weighted mix of the newest close and the previous level plus previous slope. That smoothed path steps forward from the latest observation plus the prior level and prior slope.

The slope-component uses the second constant on the change in successive levels. That term is treated as a 13-week trend on the 26-week filter and a six-week trend on the 12-week filter.

Form the macd-line after both filters exist

The MACD series is the 12-week DEMA2 filter minus the 26-week DEMA2 filter. That difference is the macd-line.

The difference is then passed through a nine-period exponential average that places a 0.2 weight on the newest MACD value. That second-stage exponential smooth is the signal-average.

Weekly Nasdaq with seeded DEMA2 filters and MACD

Weekly Nasdaq closes from early August 1987 through mid-February 1988, with the slow and fast DEMA2 level components (26-week and 12-week windows) and the MACD line formed after both filters are specified. Numbers are taken cell-for-cell from the source spreadsheet, including the crash weeks of October 1987.
Weekly Nasdaq closes from early August 1987 through mid-February 1988, with the slow and fast DEMA2 level components (26-week and 12-week windows) and the MACD line formed after both filters are specified. Numbers are taken cell-for-cell from the source spreadsheet, including the crash weeks of October 1987.NASDAQ · weekly · 1987-08-04T00:00:00.000Z to 1988-02-12T00:00:00.000Z

Each DEMA2 filter is regression-seeded on the first weekly close: slow window uses alpha 0.074 and beta 0.143 with slope -5.16 and intercept 448.35; fast window uses alpha 0.154 and beta 0.286 with slope -10.15 and intercept 479.48. Level (SM) and trend (TM) components update separately. The 9-period EMA of MACD is shown as a reference once it exists in the sheet.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
11 of 80 in the MACD track
19941-13 pp.Next on MACDConstructing MACD from lag-reduced exponential averagesA conventional moving average of period w has the same long-run lag as a matching exponential average: (w-1)/2, which equals (1-alpha)/alpha when the smoothing constant is 2/(w+1).
All readings on this track · 80 readings
  1. 1988Rebuild MACD-Mo and MACD-H before treating them as signals
  2. 1989Four-span MACD lookbacks as perishable parameters
  3. 1989Weekly then daily MACD confirmation on individual stocks
  4. 1991Regime-gated MACD and stochastic rules inside a checklist
  5. 1991Constructing MACD signal lines and divergence tests
  6. 1991MACD parameter order and cycle phase lag
  7. 1992Lengthened bond MACD as an equity regime filter
  8. 1992Long-horizon MACD construction from paired exponential averages
  9. 1993Constructing a signed ten-point trend filter
  10. 1994Constructing lag-reduced double exponential averages for MACD
  11. 1994Seeding DEMA2 filters to build a MACD signal
  12. 1994Constructing MACD from lag-reduced exponential averages
  13. 1994TEMA1 from nested exponential averages, then a two-horizon MACD
  14. 1994Constructing entry and exit on a relative-strength MACD
  15. 1994Constructing a relative-strength MACD crossover spreadsheet
  16. 1995Consensus presignal filters for Relative Strength Index, MACD and the Stochastic oscillator
  17. 1997Confirm the MACD turn with price, then exit on the histogram
  18. 1997Reconstructing a stochastic oscillator, MACD, and a triple-smoothed oscillator
  19. 1997Moving-average windows before crossovers and MACD
  20. 1999Second-stage MACD on relative-strength inputs
  21. 1999Constructing MACD from exponential-average spreads for crossover and divergence
  22. 1999Coding candlesticks into numeric indicators
  23. 2001Second-low confirmation with a percentage oscillator and money-flow filter
  24. 2001Constructing MACD from exponential average spreads and a signal line
  25. 2002Separate bounded and trend-following oscillator rules
  26. 2002Sort the regime before assigning MACD and stochastic jobs
  27. 2002Building classic divergence filters from RSI and MACD
  28. 2002Weekly highs and lows as trend gates
  29. 2002Constructing channel-normalized Fisher reversal signals
  30. 2002Affine-price and the Fisher transform as a constructed companion to MACD
  31. 2003Regularized EMA construction with a MACD line and a thrust oscillator
  32. 2003Curvature-penalized exponential averages versus MACD
  33. 2003MACD, moving averages, and a trend filter as one timing system
  34. 2003Fractional MACD and linear-regression reversal construction
  35. 2004Weekly MACD-histogram timing of bear-market rallies
  36. 2004Candlestick triggers filtered by MACD divergence
  37. 2004Staging energy-complex tops with trendline, breakout, and MACD
  38. 2005Selling climax holds versus fails
  39. 2006Treat a sideways Wave as permission before a breakout
  40. 2007MACD with a Stochastic oscillator for spotting trend reversals
  41. 2007Rebuilding an S&P 500 fifth-wave count after a broken target
  42. 2007Constructing MACD, RSI, and stochastic confirmation for futures
  43. 2007MACD histogram divergence needs a confirming close
  44. 2007Write the plan as a stack: ratio, boundary, then oscillators
  45. 2008MACD divergence and Stochastic oscillator confirmation on lumber futures
  46. 2008Assign confirmation, timing, and a stop before a currency pair is tested
  47. 2008Confirm the ten-bagger launch path before the MACD exit
  48. 2008Reading the offloaded evidence file
  49. 2008A Leader companion for MACD direction warnings
  50. 2008Relative strength exits with MACD averages and RSI
  51. 2008Assign one job per indicator in a three-screens rule set
  52. 2008Sequencing RSI, MACD, and average crossovers
  53. 2010Constructing the Schaff Trend Cycle from MACD and a dominant-cycle window
  54. 2010Schaff Trend Cycle as a MACD and Stochastic oscillator combination
  55. 2010Combining Relative Strength Index, the stochastic oscillator, and MACD as slope filters
  56. 2010Short-term wave and ratio clues without direction calls
  57. 2010A precise pullback entry and an unplanned profit-protection exit
  58. 2010Filtering MACD false signals with trendline breaks
  59. 2011Vendor feeds as an input variable in a MACD evaluation
  60. 2012Out-of-the-money versus in-the-money option sensitivity to implied volatility
  61. 2012MACD window tuning as hold-time control
  62. 2012Combining a moving-average crossover with MACD and support-resistance
  63. 2012Testing a published MACD entry with a histogram and signal-line agreement filter
  64. 2012Treat sample systems as a lab before live rules
  65. 2013Constructing moving averages and MACD from one price series
  66. 2013The next-bar price that forces a MACD signal-line cross
  67. 2013Constructing next-bar MACD reversal prices
  68. 2013Constructing inverted MACD reversal prices
  69. 2014Shared-filter combinations of the stochastic oscillator, MACD, and RSI
  70. 2014Square-root lookbacks for combined MACD and RSI
  71. 2015Audit open interest and trend before trusting oscillator crossovers
  72. 2016MACD without a signal line, confirmed by moving-average trend filters
  73. 2016Use RSI, MACD, and a moving average as a market-health consensus
  74. 2016MACD line versus histogram is a display problem first
  75. 2017Weekly and daily MACD on a single daily chart
  76. 2017Weekly and daily MACD as a stacked momentum filter
  77. 2017Nested weekly and daily MACD from paired EMA spreads
  78. 2018Weekly and daily PPO scale versus MACD, with bounded RSI and stochastic readings
  79. 2018Constructing a weekly and daily percentage price oscillator
  80. 2020Constructing Wyckoff tape reading with MACD, moving-average, and RSI filters
All 115 readings tagged MACD
Also on MACD5 readings