OPEN-SOURCE SCRIPT
Bullish Divergence SMI Base & Trigger with ATR Filter

Description:
A bullish divergence indicator combining the Stochastic Momentum Index (SMI) and Average True Range (ATR) to pinpoint high-probability entries:
1. Base Arrow (Orange ▲):
• Marks every SMI %K / %D bullish crossover where %K < –70 (deep oversold)—the first half of the divergence setup.
• Each new qualifying crossover replaces the previous base, continuously “arming” the divergence signal.
• Configurable SMI lookbacks, oversold threshold, and a base timeout (default 100 days) to clear stale bases.
2. Trigger Arrow (Green ▲):
• Completes the bullish divergence: fires on the next SMI bullish crossover where %K > –60 and price has dropped below the base arrow’s close by at least N × ATR (default 1 × 14-day ATR).
• A dashed green line links the base and trigger to visually confirm the divergence.
• Resets after triggering, ready for a new divergence cycle.
Inputs:
• SMI %K Length, EMA Smoothing, %D Length
• Oversold Base Level (–70), Trigger Level (–60)
• ATR Length (14), ATR Multiplier (1.0)
• Base Timeout (100 days)
Ideal for any market, this study highlights genuine bullish divergences—oversold momentum crossovers that coincide with significant price reactions—before entering long trades.
A bullish divergence indicator combining the Stochastic Momentum Index (SMI) and Average True Range (ATR) to pinpoint high-probability entries:
1. Base Arrow (Orange ▲):
• Marks every SMI %K / %D bullish crossover where %K < –70 (deep oversold)—the first half of the divergence setup.
• Each new qualifying crossover replaces the previous base, continuously “arming” the divergence signal.
• Configurable SMI lookbacks, oversold threshold, and a base timeout (default 100 days) to clear stale bases.
2. Trigger Arrow (Green ▲):
• Completes the bullish divergence: fires on the next SMI bullish crossover where %K > –60 and price has dropped below the base arrow’s close by at least N × ATR (default 1 × 14-day ATR).
• A dashed green line links the base and trigger to visually confirm the divergence.
• Resets after triggering, ready for a new divergence cycle.
Inputs:
• SMI %K Length, EMA Smoothing, %D Length
• Oversold Base Level (–70), Trigger Level (–60)
• ATR Length (14), ATR Multiplier (1.0)
• Base Timeout (100 days)
Ideal for any market, this study highlights genuine bullish divergences—oversold momentum crossovers that coincide with significant price reactions—before entering long trades.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。