• Products
  • Community
  • Markets
  • Brokers
  • More
Black FridayUp to 80% OFF
  • Indicators and strategies
  • /Convenientoriginalscript

Convenientoriginalscript

MACD Divergence auto displayed on chart, with alertsMACD Pivot Divergence Detector This tool identifies MACD histogram divergences based on confirmed pivot highs and lows. Instead of comparing swing points on the MACD line, this script focuses specifically on the histogram, which measures momentum shifts between MACD and Signal. How it works The script detects confirmed pivots using a two-bar swing structure. When price breaks above a previous pivot high, the script compares the MACD histogram value at that pivot to the current histogram value: • If price makes a higher high while the histogram makes a lower high, a potential bearish divergence is marked. The reverse logic is applied for bullish divergence when price breaks below a pivot low. What makes this script unique It uses pivot-confirmed histogram values, not lookback-based divergence. It evaluates divergence only at actual highs/lows, reducing false positives. It marks divergence directly on the candles for visual clarity. Alert conditions are included for automated detection. How to use Bullish signals may highlight potential momentum loss in downtrends; bearish signals may highlight momentum loss near highs. Divergence does not guarantee reversal and should be combined with broader context, structure, or trend analysis.
Pine Script® indicator
by affxsup

Select market data provided by ICE Data Services. Select reference data provided by FactSet. Copyright © 2025 FactSet Research Systems Inc.Copyright © 2025, American Bankers Association. CUSIP Database provided by FactSet Research Systems Inc. All rights reserved. SEC fillings and other documents provided by Quartr.© 2025 TradingView, Inc.

More than a product
  • Supercharts
Screeners
  • Stocks
  • ETFs
  • Bonds
  • Crypto coins
  • CEX pairs
  • DEX pairs
  • Pine
Heatmaps
  • Stocks
  • ETFs
  • Crypto
Calendars
  • Economic
  • Earnings
  • Dividends
More products
  • Yield Curves
  • Options
  • News Flow
  • Pine Script®
Apps
  • Mobile
  • Desktop
Community
  • Social network
  • Wall of Love
  • Refer a friend
  • House Rules
  • Moderators
Ideas
  • Trading
  • Education
  • Editors' picks
Pine Script
  • Indicators & strategies
  • Wizards
  • Freelancers
Tools & subscriptions
  • Features
  • Pricing
  • Market data
  • Gift plans
Trading
  • Overview
  • Brokers
Special offers
  • CME Group futures
  • Eurex futures
  • US stocks bundle
About company
  • Who we are
  • Space mission
  • Blog
  • Careers
  • Media kit
Merch
  • TradingView store
  • Tarot cards for traders
  • The C63 TradeTime
Policies & security
  • Terms of Use
  • Disclaimer
  • Privacy Policy
  • Cookies Policy
  • Accessibility Statement
  • Security tips
  • Bug Bounty program
  • Status page
Business solutions
  • Widgets
  • Charting libraries
  • Lightweight Charts™
  • Advanced Charts
  • Trading Platform
Growth opportunities
  • Advertising
  • Brokerage integration
  • Partner program
  • Education program
Community
  • Social network
  • Wall of Love
  • Refer a friend
  • House Rules
  • Moderators
Ideas
  • Trading
  • Education
  • Editors' picks
Pine Script
  • Indicators & strategies
  • Wizards
  • Freelancers
Business solutions
  • Widgets
  • Charting libraries
  • Lightweight Charts™
  • Advanced Charts
  • Trading Platform
Growth opportunities
  • Advertising
  • Brokerage integration
  • Partner program
  • Education program
Look FirstLook First