Stockenza Method
Section · 5 metrics

MACD

The Moving Average Convergence Divergence indicator.

01
12-Period EMA
The 12-period exponential moving average of the closing price.
💡 The Idea

The 12-period exponential moving average of the closing price. It's the fast line that feeds into the MACD calculation — the first of the two EMAs whose distance becomes the MACD line.

❓ Why It Matters

The 12EMA reacts quickly to fresh price action. Comparing it to the slower 26EMA reveals whether short-term momentum is outpacing the medium-term trend. When the 12EMA rises above the 26EMA, momentum is shifting bullish.

📐 The Formula
12_PeriodEMA = EMA of Close over 12 periods α = 2 ÷ (12 + 1) = 0.1538 EMA(t) = α × Close(t) + (1 − α) × EMA(t−1)
🔌 Data Sources

Computed

🔬 How We Compute It

We compute an exponential moving average of the closing prices over the last 12 periods using pandas' ewm with span=12, adjust=False. This is the same convention used by charting platforms like TradingView.

📊 How to Read It
  • 12EMA above 26EMA → MACD line is positive (bullish bias).
  • 12EMA below 26EMA → MACD line is negative (bearish bias).
  • The wider the gap between 12EMA and 26EMA, the stronger the momentum.
  • 12EMA crossing 26EMA is the fundamental MACD signal.
⚠️ Common Mistakes
  1. Using it standalone — it's the input to MACD, not a signal by itself.
  2. Confusing EMA with SMA — EMA gives more weight to recent prices.
02
26-Period EMA
The 26-period exponential moving average of the closing price.
💡 The Idea

The 26-period exponential moving average of the closing price. It's the slow line in the MACD calculation — the slower of the two EMAs whose distance becomes the MACD line.

❓ Why It Matters

The 26EMA represents the medium-term trend. When the faster 12EMA crosses above it, the market is signalling that recent price action has outpaced the medium-term — often the start of a bullish phase. The reverse is also true.

📐 The Formula
26_Period_EMA = EMA of Close over 26 periods α = 2 ÷ (26 + 1) = 0.0741
🔌 Data Sources

Computed

🔬 How We Compute It

Pandas ewm with span=26, adjust=False. Standard EMA convention — matches MACD's original design by Gerald Appel.

📊 How to Read It
  • 26EMA is the baseline that MACD measures against.
  • Price well above 26EMA → medium-term trend is strong.
  • Price crossing 26EMA → trend could be changing.
  • 26EMA slope indicates medium-term direction.
⚠️ Common Mistakes
  1. Using it alone — always pair with 12EMA for MACD analysis.
  2. Comparing directly to 12EMA — they serve different roles.
🔗 Related Metrics
03
MACD Sentiment
A five-band interpretation of the MACD indicator.
💡 The Idea

A five-band interpretation of the MACD indicator. It classifies the relationship between the MACD line and its signal line into one of five states, from Very Positive (fresh bullish crossover) to Very Negative (fresh bearish crossover).

❓ Why It Matters

The MACD is one of the most widely used momentum systems in the world. The MACD line vs. signal line relationship is the core signal. This column translates that raw relationship into a clear sentiment — so you don't have to eyeball a histogram to know what MACD is saying.

📐 The Formula
MACD Line = 12EMA − 26EMA Signal Line = 9EMA of the MACD Line MACD crosses above Signal → Very Positive - Bullish Crossover MACD crosses below Signal → Very Negative - Bearish Crossover MACD above Signal (steady) → Positive - MACD Above Signal MACD below Signal (steady) → Negative - MACD Below Signal MACD equals Signal → Neutral
🔌 Data Sources

Computed

🔬 How We Compute It

We compute the MACD line as the difference between the 12-period and 26-period EMAs, then compute a 9-period EMA of the MACD line (the signal line). Each bar, we check whether the two lines have crossed on that bar, or are simply positioned above/below each other.

📊 How to Read It
  • Very Positive → fresh bullish crossover; strongest signal.
  • Positive → MACD still above signal; bullish bias intact.
  • Neutral → lines at parity; no directional edge.
  • Negative → MACD below signal; bearish bias.
  • Very Negative → fresh bearish crossover; strongest bearish signal.
⚠️ Common Mistakes
  1. Trading every crossover — MACD whipsaws in choppy markets.
  2. Ignoring the histogram magnitude — a shallow cross is weaker than a deep one.
  3. Using MACD alone — combine with trend and volume.
04
MACD + Volume 200MA Signal
A multi-factor sentiment that combines the MACD crossover with volume confirmation and the stock's position relative to its 200-day moving average.
💡 The Idea

A multi-factor sentiment that combines the MACD crossover with volume confirmation and the stock's position relative to its 200-day moving average. It's designed to filter out weak MACD signals that lack broader confirmation.

❓ Why It Matters

A MACD crossover on its own is common and often unreliable. When it's confirmed by above-average volume AND a price above the 200MA, the signal is far more trustworthy. This column does that filtering automatically — saving you from chasing false breakouts.

📐 The Formula
For each bar, compute: • MACD Bullish Crossover this bar? • MACD Bearish Crossover this bar? • Volume > 1.5× the 20-day average? • Price > 200MA? Bullish cross + high volume + above 200MA → Very Positive Bullish cross + one confirmation → Positive Bullish cross + no confirmations → Neutral Bearish cross + high volume + below 200MA → Very Negative Bearish cross + one confirmation → Negative Bearish cross + no confirmations → Neutral No cross, MACD above signal → Positive No cross, MACD below signal → Negative
🔌 Data Sources

Computed

🔬 How We Compute It

We combine the MACD crossover signal with two independent confirmations: volume ratio against the 20-day average, and price vs. 200MA. Only when all three align does the signal reach its strongest tier.

📊 How to Read It
  • Very Positive → high-conviction bullish setup; all three factors agree.
  • Positive → bullish crossover or steady bias with partial confirmation.
  • Neutral → crossover occurred but nothing else confirms.
  • Negative → bearish crossover with some confirmation.
  • Very Negative → high-conviction bearish setup; all three factors agree.
⚠️ Common Mistakes
  1. Treating Positive as a strong signal — it's partial.
  2. Ignoring the 200MA component — that's what separates real trends from noise.
05
MA Compression Breakout Sentiment
A direction-aware signal that reads the MA Ribbon Compression.
💡 The Idea

A direction-aware signal that reads the MA Ribbon Compression. When moving averages are compressed AND price breaks decisively out of the ribbon, this column flags the breakout as bullish or bearish.

❓ Why It Matters

Compression setups are historically the best time to enter trades — but only after the direction becomes clear. This column tells you when compression has resolved into a breakout, and in which direction. It's how you catch big moves early without guessing.

📐 The Formula
If compression < 2 AND Close > 5MA > 10MA → Very Positive - Bullish Breakout If compression < 2 AND Close < 5MA < 10MA → Very Negative - Bearish Breakdown If compression < 3 AND Close > 5MA → Positive - Bullish Setup If compression < 3 AND Close < 5MA → Negative - Bearish Setup If compression < 3 → Neutral - Compressed, No Direction Else → Neutral - No Compression
🔌 Data Sources

Computed

🔬 How We Compute It

We check the compression value against two thresholds (extreme < 2, mild < 3) and combine that with the direction of price relative to the 5MA and 10MA. The result describes whether the breakout is confirmed and in which direction.

📊 How to Read It
  • Very Positive → the strongest bull setup from compression.
  • Positive → early bullish signs; breakout forming.
  • Neutral → compressed but direction not yet decided.
  • Negative → early bearish signs.
  • Very Negative → the strongest bear setup from compression.
⚠️ Common Mistakes
  1. Entering on 'Neutral - Compressed' — wait for direction.
  2. Ignoring volume — a compression breakout on weak volume often fails.