OPEN-SOURCE SCRIPT
SMT Divergences Dual Lookback - MoonTrades

This Pine Script, titled "SMT Divergences Dual Lookback", is designed to detect and visualize divergences between two comparison symbols (symbols A and B) using two different lookback periods. The script specifically identifies bullish and bearish divergences based on pivot highs and lows and marks them on the chart with color-coded labels.
Bullish Divergence (Swing High) is marked when a price swing low diverges from a pivot low, indicating potential upward momentum.
Bearish Divergence (Swing Low) is marked when a price swing high diverges from a pivot high, indicating potential downward momentum.
The script works with two customizable comparison symbols and can also apply a specific timeframe for divergence detection (separate from the chart’s default timeframe). The results are displayed with labels showing the corresponding symbols, helping traders identify potential reversal points or continuation trends.
Users can customize the lookback periods and the colors for the divergence markers. This tool aids in technical analysis for traders who focus on multi-timeframe and multi-symbol divergence strategies.
Bullish Divergence (Swing High) is marked when a price swing low diverges from a pivot low, indicating potential upward momentum.
Bearish Divergence (Swing Low) is marked when a price swing high diverges from a pivot high, indicating potential downward momentum.
The script works with two customizable comparison symbols and can also apply a specific timeframe for divergence detection (separate from the chart’s default timeframe). The results are displayed with labels showing the corresponding symbols, helping traders identify potential reversal points or continuation trends.
Users can customize the lookback periods and the colors for the divergence markers. This tool aids in technical analysis for traders who focus on multi-timeframe and multi-symbol divergence strategies.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.