OPEN-SOURCE SCRIPT

Smart Price Divergence (MACD Filter) + EMA

166
📌 Purpose
This indicator detects Price Divergences with MACD filtered by a 200 EMA trend condition.
It helps identify high-probability reversal zones aligned with market trend context.

🧠 How It Works
1. MACD Divergence Logic
Bearish Divergence:

Price makes a higher high.

MACD makes a lower high.

Price is above EMA (indicating possible exhaustion in bullish trend).

Bullish Divergence:

Price makes a lower low.

MACD makes a higher low.

Price is below EMA (indicating possible exhaustion in bearish trend).

2. EMA Trend Filter
EMA(200) is used as a directional filter:

Bearish divergences considered above EMA (extended bullish conditions).

Bullish divergences considered below EMA (extended bearish conditions).

3. Visual & Alerts
EMA(200) plotted on chart in orange.

Red triangles for Bearish Divergence.

Green triangles for Bullish Divergence.

Alerts fire for both divergence types.

📈 How to Use
Look for divergence signals as potential reversal alerts.

Combine with support/resistance or price action for confirmation.

EMA ensures signals occur in extended zones, increasing reliability.

Recommended Timeframes: 1h, 4h, D.
Markets: Forex, Crypto, Stocks.

⚙️ Inputs
MACD Fast / Slow / Signal Length

EMA Length (default 200)

⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。