OPEN-SOURCE SCRIPT
Aktualisiert MACD Slope & Swing Monitor

This script is not just another MACD. It is a highly specialized momentum engine designed to quantify trend exhaustion and visualize structural pivots, making it the perfect tool for trading advanced concepts like the "Anti-Setup" (popularized by Linda Raschke) and Hidden Divergences.
While standard MACD shows you the current momentum, it often lags during complex corrections (like Elliott Wave 4th waves or Flat corrections). This indicator solves this by introducing real-time Slope Quantification and past Swing Pivot Detection.
Key Features & The Logic Behind the Mashup:
Dynamic Slope Quantification: Calculates the exact rate of change (Slope) for both the MACD and Signal lines over a user-defined lookback period. This allows traders to spot momentum decay before an actual crossover occurs. The exact values are displayed on a clean, dynamic label that tracks the current bar.
Structural Swing Detection (Pivots): Uses a 5-bar left/right lookback to plot Swing Highs and Lows directly on the oscillator. By locking these markers to the top and bottom of the pane, the script keeps the MACD lines perfectly clean. This is crucial for instantly identifying Hidden Divergences against previous structural peaks.
Custom MA Engine: Unlike standard built-in MACD, this script allows you to independently change the Moving Average type (SMA, EMA, WMA, RMA) for both the Oscillator and the Signal line. (e.g., using EMA for the oscillator and SMA for the signal to refine trade timing).
How to Use:
Trend Continuation (Hidden Divergence): Look for price to make a Lower High / Higher Low, while the MACD Swing markers show a Higher High / Lower Low.
The "Anti" Trigger: Wait for the MACD Slope to sharply reverse back toward the Signal line in the direction of the primary trend. The real-time label will confirm the momentum shift mathematically before the visual hook forms.
While standard MACD shows you the current momentum, it often lags during complex corrections (like Elliott Wave 4th waves or Flat corrections). This indicator solves this by introducing real-time Slope Quantification and past Swing Pivot Detection.
Key Features & The Logic Behind the Mashup:
Dynamic Slope Quantification: Calculates the exact rate of change (Slope) for both the MACD and Signal lines over a user-defined lookback period. This allows traders to spot momentum decay before an actual crossover occurs. The exact values are displayed on a clean, dynamic label that tracks the current bar.
Structural Swing Detection (Pivots): Uses a 5-bar left/right lookback to plot Swing Highs and Lows directly on the oscillator. By locking these markers to the top and bottom of the pane, the script keeps the MACD lines perfectly clean. This is crucial for instantly identifying Hidden Divergences against previous structural peaks.
Custom MA Engine: Unlike standard built-in MACD, this script allows you to independently change the Moving Average type (SMA, EMA, WMA, RMA) for both the Oscillator and the Signal line. (e.g., using EMA for the oscillator and SMA for the signal to refine trade timing).
How to Use:
Trend Continuation (Hidden Divergence): Look for price to make a Lower High / Higher Low, while the MACD Swing markers show a Higher High / Lower Low.
The "Anti" Trigger: Wait for the MACD Slope to sharply reverse back toward the Signal line in the direction of the primary trend. The real-time label will confirm the momentum shift mathematically before the visual hook forms.
Versionshinweise
Update: Adjustable Pivot Sensitivity & Dashboard UIIn this update, I have refined the visual clarity and added customization options to help you better adapt to different market volatilities.
1. Adjustable Swing Pivot Sensitivity (Noise Filter)
You can now fully customize the lookback period (Left and Right Bars) for Swing High/Low detection directly from the settings menu.
The default lookback has been increased from 5 to 7. This provides a stronger filter against minor market noise, allowing you to focus purely on major structural swings for higher-probability Hidden Divergence and "Anti" setups.
The marker offset now dynamically adapts to your chosen right-bar period, ensuring perfect visual alignment on the chart.
2. Fixed Dashboard UI (Slope Monitor)
Upgraded the real-time Slope Monitor display. Instead of a floating label that follows the last candle, the exact slope values are now locked into a clean, fixed Table Dashboard (Top Right).
This keeps the MACD oscillator completely free of clutter, giving you a pure view of the momentum waves while the crucial numbers remain constantly visible in your peripheral vision.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.