OPEN-SOURCE SCRIPT
Atualizado

MACD Zero-Line Dominance (no ta.sum)

135
Description Option 1 (Simple & Clear)

“This indicator compares how many recent bars have the MACD line above the zero line versus below it.
It plots the resulting strength as a green/red histogram showing whether bullish or bearish momentum is dominating.”

“MACD Zero-Line Dominance measures the strength balance between bullish and bearish momentum by counting how many candles in a lookback period have MACD above or below the zero line.
The histogram turns green when bullish pressure dominates and red when bearish momentum takes control.
Useful for trend confirmation, regime detection, and higher-timeframe alignment.”
Notas de Lançamento
This indicator measures MACD zero-line dominance on the current chart timeframe and plots a histogram showing whether recent bars had MACD above or below zero. It then color-codes each bar with a 10% significance filter to highlight meaningful easing/acceleration in momentum:
Above zero (bullish regime)
Green = dominance growing or steady
Red = bar shrinks ≥ 10% vs previous bar (bullish momentum easing)
Below zero (bearish regime)
Red = dominance growing or steady
Green = bar shrinks ≥ 10% vs previous bar (bearish momentum easing)
Exactly zero = gray
In short: it shows not just which side is in control (above/below zero), but also when that control is weakening by at least 10% compared to the prior bar.
Key inputs
MACD Fast EMA / Slow EMA – standard MACD settings (12/26 by default)
Dominance Lookback – window used to count how many bars had MACD above vs below zero (default 20). Output range is −len to +len.
Flip Threshold (%) – minimum relative change vs the previous histogram bar to trigger a color flip (default 10%). Raise this to reduce noise; lower it to be more sensitive.
How to read it
Histogram > 0: more bars (in the lookback) had MACD above zero → bullish backdrop.
Histogram < 0: more bars had MACD below zero → bearish backdrop.
Color flips:
Green→Red while > 0: bulls still control, but momentum eased by ≥10%.
Red→Green while < 0: bears still control, but momentum eased by ≥10%.
Suggested uses
1) Trend filter & timing
Trade longs when the histogram is > 0; avoid/size down when it turns red (bullish dominance easing).
Trade shorts when the histogram is < 0; avoid/cover partial when it turns green (bearish dominance easing).
A cross through zero often marks regime change; wait for price confirmation (break of structure, MA reclaim, etc.).
2) Add to your entry setup
Continuation longs: Price pullback into support while histogram stays > 0 and flips back to green after a brief red-easing bar.
Continuation shorts: Price pullback into resistance while histogram stays < 0 and flips back to red after a brief green-easing bar.
3) Early risk management
In an open long, if bars remain > 0 but keep printing red-easing, tighten stops or take partials.
In an open short, if bars remain < 0 but print green-easing, consider scaling out or trailing tighter.
4) Multi-timeframe workflow
Use higher TF (e.g., 4H/D) as the bias: trade in the direction of its histogram sign.
Use your execution TF (e.g., 5–15 min) to time entries using the easing flips and zero-cross behavior.
5) Combine with price action
Pair with structure (HH/HL for longs; LH/LL for shorts).
Use VWAP/MA as dynamic S/R; prefer entries when the histogram agrees with a reclaim/reject of those lines.
Divergences: Price makes a new swing, but the histogram fails to expand further → momentum fatigue.
Alerts (optional ideas)
Zero cross (strength crosses 0)
Easing flip (green→red above 0, or red→green below 0)
Max expansion (new N-bar high/low in dominance to confirm strong trend)
Limitations & tips
It’s a derived momentum tool; don’t use it alone for entries. Confirm with price/volume/liquidity.
The 10% threshold is relative to the previous bar. If your market is choppy, raise it (e.g., 15–20%) to reduce whipsaws.
Lookback length affects stability: shorter = more reactive; longer = smoother but slower.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.