MACD Pro Scanner - Divergence and MTF Context

253
OVERVIEW

MACD Pro Scanner brings momentum analysis, divergence detection, multi-timeframe monitoring, and price context into one workspace.

The indicator uses an MT5-style MACD display and adds a signal-envelope exit condition, regular and early divergence detection, a configurable 19-symbol dashboard, pivot-based support and resistance trend lines, an estimated volume profile, and alerts.

The purpose of combining these components is to examine a momentum event alongside its broader context. MACD provides the momentum reading, divergence highlights differences between price and momentum, the dashboard compares selected timeframes, and the price overlays help users assess where an event occurs.

This is an analytical indicator. It does not execute trades or provide strategy backtest results.


MACD CALCULATION AND DISPLAY

The core calculation is:

MACD = Fast EMA - Slow EMA
Signal = SMA of MACD

Default lengths are 12, 26, and 9.

The histogram plots the MACD value itself. This differs from the common MACD histogram that plots MACD minus its signal line. The signal line uses a simple moving average.

The MT5-style reference describes this calculation and presentation convention. It does not imply identical readings across platforms, brokers, or data feeds.

Available display modes include histogram bars, a MACD line, or both.

By default:
• Light gray bars indicate MACD at or above the signal line.
• Dark gray bars indicate MACD below the signal line.
• The optional MACD line changes color according to its position above or below zero.

The chart-timeframe calculation uses the selected source input. The requested dashboard calculations use closing prices.


SIGNAL-ENVELOPE EXIT LOGIC

The script checks whether the signal line lies between zero and the MACD value.

An “inside” state exists when:
• MACD is positive and the signal line is between zero and MACD; or
• MACD is negative and the signal line is between MACD and zero.

An exit event occurs when the previous bar was inside this range and the current bar is outside it.

The script classifies that event using the current MACD position:
• Below zero: a bullish event, labeled AL.
• Above zero: a bearish event, labeled SAT.

This is a transition out of a defined range. It should not be interpreted as every MACD crossover or as a guaranteed price reversal.

Optional background shading highlights the inside state: green below zero and red above zero. Optional markers show exit events in the oscillator pane and on the price chart.

Live markers can change before the chart bar closes. Dedicated chart-timeframe closing alerts evaluate the condition at bar close.


REGULAR DIVERGENCE

Regular divergence compares MACD pivots with price highs or lows at the corresponding bars.

• Bullish divergence: price makes a lower low while MACD makes a higher low.
• Bearish divergence: price makes a higher high while MACD makes a lower high.

Users can adjust the left and right pivot strengths and the minimum and maximum distance between compared pivots.

When enabled, divergence lines appear in both the MACD pane and the price chart.

Timing matters: a pivot requires the configured number of right-side bars before it can be identified. With the default setting of five right-side bars, the pivot can only be identified five bars after its location, once the necessary data is available.

The resulting drawing is anchored to the earlier pivot bar. It was not available on that bar in real time. A developing confirmation bar can also affect the condition until that bar closes.


EARLY DIVERGENCE

The early-divergence module looks for developing divergence using a previous identified MACD pivot, recent price and oscillator extremes, and a configurable sequence of rising or falling MACD values.

Yellow triangles and optional dotted price lines distinguish these preliminary events from regular pivot-based divergence.

Settings control the directional sequence, minimum separation, and waiting period before another early event can be issued.

An early event may change or disappear and may never become a regular divergence. It is a preliminary observation, not a confirmed reversal.


MULTI-TIMEFRAME DASHBOARD

The chart-symbol information panel displays:
• The chart timeframe.
• A configurable upper timeframe.
• A configurable lower timeframe.

The default requested timeframes are daily and four-hour.

An optional scanner dashboard provides 19 configurable symbol slots. Each row displays the MACD position relative to zero, the inside/outside state, and the exit-event reading for the two selected timeframes.

The “swing” and “scalp” labels identify the two dashboard columns. They do not establish that a particular timeframe is suitable for a particular trading style.

Multi-timeframe readings provide context for manual comparison. They do not automatically filter the chart-timeframe signals.

The requested values can include developing timeframe bars. A chart-bar close does not necessarily mean that a requested higher-timeframe bar has closed. Dashboard readings and scanner alerts should therefore not be treated as confirmed higher-timeframe signals.

Scanner updates follow the chart’s execution and available market data. This is a fixed symbol list, not an exchange-wide screener or an independent tick stream for every selected instrument.

For more straightforward interpretation, use a chart timeframe no higher than the smaller requested timeframe. Requests below the chart timeframe do not provide a complete record of every intrabar event.


PIVOT-BASED TREND LINES

The price overlay connects:
• The two most recent identified pivot highs for a resistance reference.
• The two most recent identified pivot lows for a support reference.

Users can adjust pivot strength, visibility, colors, width, labels, and right-side extension.

These lines use the chart timeframe. They are visual references rather than separately calculated higher-timeframe support and resistance levels.

Pivot identification introduces a delay. Lines are anchored to earlier pivot bars and are replaced as new pivots become available. Their presence does not establish that price will respect or reverse at them.


ESTIMATED VOLUME PROFILE

The optional volume profile distributes each included candle’s reported volume evenly across the price rows covered by its high-low range.

Volume is classified by candle direction:
• Close at or above open.
• Close below open.

The highlighted point of control is the row with the highest total allocated volume in this estimate.

This is a candle-based approximation. The two colors do not represent directly measured aggressive buying and selling, bid/ask volume, or order-flow delta.

Results depend on the instrument’s volume data. Where volume is unavailable, the script substitutes a unit value, so the display should not be interpreted as measured traded volume.

The profile recalculates as its rolling sample and price range change.


ALERTS

Available alert features include:
• Chart-timeframe bullish and bearish exit events.
• Dedicated chart-bar closing notifications.
• Optional notifications within a selected number of minutes before the scheduled chart-bar close.
• Regular bullish and bearish divergence conditions.
• Early bullish and bearish divergence conditions.
• Optional dashboard-symbol exit notifications.

To receive the script’s dynamic messages, create an alert using “Any alert() function call” and enable the relevant options in the indicator settings.

For the separately listed MACD and divergence conditions, select the corresponding condition in TradingView’s alert dialog. Choose “Once Per Bar Close” when closed-chart-bar evaluation is preferred.

Pre-close notifications require a realtime chart update within the selected time window. They are not guaranteed to arrive at an exact minute, and their conditions may no longer exist when the bar closes.

Dashboard alerts are evaluated through the chart’s execution. They do not independently verify the closing time of every requested symbol and timeframe.

After changing settings, symbols, or timeframes, recreate the affected TradingView alerts so they use the intended configuration.


SUGGESTED WORKFLOW

1. Set the MACD lengths and chart source.
2. Choose the two dashboard timeframes.
3. Review the MACD position relative to zero and the signal-envelope state.
4. Compare chart events with the selected timeframe readings.
5. Examine divergence and nearby pivot-based trend lines.
6. Enable the estimated volume profile if its data is useful for the selected instrument.
7. Configure alerts according to whether preliminary or closed-chart-bar notifications are desired.

The components provide separate observations. Their agreement is not a validated probability of success.


ENGLISH GUIDE TO THE TURKISH INTERFACE

The current interface includes Turkish labels.

Settings groups:
• MACD Ayarları: MACD Settings.
• Sinyal & Görünüm: Signals & Display.
• MACD Uyumsuzluk (Normal + Erken): MACD Divergence (Regular + Early).
• Alarmlar: Alerts.
• Hacim Profili: Volume Profile.
• Trend Çizgileri: Trend Lines.
• Stil & Renkler: Style & Colors.
• Paneller: Panels.
• Tarama Sembolleri: Scanner Symbols.

Signal and dashboard terms:
• AL / SAT: Buy / Sell condition labels.
• Teyitli: Confirmed; chart-timeframe closing notifications refer to the chart bar.
• Uyumsuzluk / Uy.: Divergence.
• Boğa / Ayı: Bullish / Bearish.
• Pozitif / Negatif: Positive / Negative.
• Erken / Hazırlan / Yaklaşıyor: Early / Prepare / Approaching.
• Kurulum: Setup.
• İçeride / Dışarı: Inside / Outside.
• Durum / Dur: State.
• Sinyal / Sin: Signal.
• Sembol / Değer / Kaynak: Symbol / Value / Source.
• Üst TF / Alt TF / Grafik TF: Upper / Lower / Chart timeframe.
• 0▲ / 0▼: MACD above / below zero.
• M / S: MACD / Signal value.

Controls and appearance:
• Göster / Aktif: Show / Enabled.
• Pivot Sol / Sağ: Left / Right pivot bars.
• Min / Maks Bar: Minimum / Maximum bar distance.
• Erken teyit bar: Early directional-sequence bars.
• Bekleme süresi: Waiting period in bars.
• Kapanışa kalan dakika: Minutes before bar close.
• Taranacak mum / Satır: Lookback candles / Rows.
• Genişlik / Kalınlık: Width / Thickness.
• Sağa kaydırma / Sağa uzat: Right offset / Extend right.
• Alıcı / Satıcı: Buying / Selling color labels based on candle direction.
• Destek / Direnç: Support / Resistance.
• Tepe / Dip: High / Low.
• Etiket / Çizgi / Çubuk: Label / Line / Bar.
• Her ikisi: Both.
• Renk / Arka plan / Yazı / Çerçeve: Color / Background / Text / Border.
• Sağ Üst / Sol Üst: Top Right / Top Left.
• Sağ Alt / Sol Alt / Orta Üst: Bottom Right / Bottom Left / Top Center.
• Çok küçük / Küçük / Normal: Tiny / Small / Normal.
• dk / sa / G / H in timeframe labels: Minutes / Hours / Days / Weeks.


LIMITATIONS

This indicator should not be described as non-repainting. Open-bar calculations, preliminary divergence, developing requested-timeframe data, and pivot drawings anchored to earlier bars all require careful interpretation.

Divergence can persist without a reversal. Exit events can occur repeatedly in choppy markets. Trend lines and estimated volume concentrations can fail as price references.

No win rate, profitability, predictive accuracy, or statistical advantage is claimed. Labels and alerts identify programmed conditions; they are not instructions to enter or exit a position.

The indicator is intended for educational and analytical use and does not constitute investment advice.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน