OPEN-SOURCE SCRIPT

MACDiver from axis V1.4

71
Indicator that identifies bullish and bearish divergences between price action and the MACD oscillator. It uses pivot highs/lows in both price and MACD series to detect potential reversal signals. When price makes higher highs (or lower lows) while MACD makes lower highs (or higher lows), the indicator marks these divergences with lines and labels on the chart, providing potential trading signals.

MACDiver Indicator Usage Guide

Purpose: Detects bullish and bearish divergences between price action and the MACD oscillator, with projected target price levels.

Key Features:

Divergence Detection: Finds mismatches between price and MACD movements
Target Projection: Calculates and displays estimated reversal price levels
Visual Signals: Shows lines, labels, and target markers on the chart
Main Settings:

pivotLR: Sensitivity for pivot detection (default: 5). Lower = more sensitive, higher = fewer false signals
searchBack: How many bars back to search for matching pivots (default: 120). Adjust based on your timeframe
showTarget: Enable/disable target price projections
showTargetLines: Enable/disable dashed projection lines
How to Use:

Identify Divergences:
Bullish: Price makes lower lows while MACD makes higher lows (green "Bull Div" label)
Bearish: Price makes higher highs while MACD makes lower highs (red "Bear Div" label)
Check Target Levels:
Green/red target label shows projected price level for bullish/bearish divergences
Dashed line extends from the divergence point to the target
Trade Entry:
Use divergence confirmation as potential entry signal
Target level as take-profit reference
Adjust Settings:
Higher pivotLR for fewer signals, lower for more sensitivity
Adjust searchBack based on typical trend lengths on your timeframe
Key Variables:

pivotLR: Number of bars to the left/right to confirm pivot highs/lows
searchBack: Maximum number of bars to look back when searching for previous matching pivots

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.