OPEN-SOURCE SCRIPT
Cập nhật SQZPRO + RSI Divergence

This indicator combines two tools in a single sub-pane below your chart:
RSI (top half of the logic) — a standard RSI plotted on its usual 0–100 scale, with horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold). Length and source are configurable.
Squeeze PRO (volatility compression) — it compares Bollinger Bands (2 standard deviations) against three Keltner Channel widths (1x, 1.5x, and 2x average true range). Depending on how tightly the Bollinger Bands are nested inside those channels, it classifies the current bar into one of five states, each shown as a colored dot sitting on the RSI's 50-line:
Blue — transitional/no clear squeeze
Yellow — narrow squeeze (tightest compression, most "coiled")
Red — normal squeeze
Black — wide squeeze (loosest compression, but still squeezed)
Green — squeeze released (bands have expanded outward — volatility breakout in progress)
There's also an optional momentum histogram (off by default, toggle "Show MOM Histogram") that shows a linear-regression-based momentum oscillator, similar to the classic squeeze momentum indicator.
RSI Divergence — this scans for pivot highs/lows in the RSI and compares them to price pivots over the same span. When RSI and price disagree, it draws a short line connecting the two RSI pivot points plus a label, directly on the RSI plot:
"Bull" (regular bullish, green) — price made a lower low but RSI made a higher low; potential reversal up
"Bear" (regular bearish, red) — price made a higher high but RSI made a lower high; potential reversal down
"H Bull" / "H Bear" (hidden divergences, dimmer colors, off by default) — typically signal trend continuation rather than reversal
These signals are confirmed lbR bars (default 5) after the actual pivot, which is normal for any divergence tool — it trades a small delay for fewer false signals.
Confluence — the script tracks when a squeeze "fires" (transitions to the green/released state) and checks whether a divergence occurred on that same bar. If both line up, it triggers a separate "Bullish Confluence" or "Bearish Confluence" alert — the idea being that a volatility expansion plus a divergence in the same direction is a stronger combined signal than either alone.
Alerts are set up for every divergence type, for squeeze release on its own, and for the two confluence cases, so you can build alerts off whichever combination matters to you.
RSI (top half of the logic) — a standard RSI plotted on its usual 0–100 scale, with horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold). Length and source are configurable.
Squeeze PRO (volatility compression) — it compares Bollinger Bands (2 standard deviations) against three Keltner Channel widths (1x, 1.5x, and 2x average true range). Depending on how tightly the Bollinger Bands are nested inside those channels, it classifies the current bar into one of five states, each shown as a colored dot sitting on the RSI's 50-line:
Blue — transitional/no clear squeeze
Yellow — narrow squeeze (tightest compression, most "coiled")
Red — normal squeeze
Black — wide squeeze (loosest compression, but still squeezed)
Green — squeeze released (bands have expanded outward — volatility breakout in progress)
There's also an optional momentum histogram (off by default, toggle "Show MOM Histogram") that shows a linear-regression-based momentum oscillator, similar to the classic squeeze momentum indicator.
RSI Divergence — this scans for pivot highs/lows in the RSI and compares them to price pivots over the same span. When RSI and price disagree, it draws a short line connecting the two RSI pivot points plus a label, directly on the RSI plot:
"Bull" (regular bullish, green) — price made a lower low but RSI made a higher low; potential reversal up
"Bear" (regular bearish, red) — price made a higher high but RSI made a lower high; potential reversal down
"H Bull" / "H Bear" (hidden divergences, dimmer colors, off by default) — typically signal trend continuation rather than reversal
These signals are confirmed lbR bars (default 5) after the actual pivot, which is normal for any divergence tool — it trades a small delay for fewer false signals.
Confluence — the script tracks when a squeeze "fires" (transitions to the green/released state) and checks whether a divergence occurred on that same bar. If both line up, it triggers a separate "Bullish Confluence" or "Bearish Confluence" alert — the idea being that a volatility expansion plus a divergence in the same direction is a stronger combined signal than either alone.
Alerts are set up for every divergence type, for squeeze release on its own, and for the two confluence cases, so you can build alerts off whichever combination matters to you.
Phát hành các Ghi chú
This indicator combines two tools in a single sub-pane below your chart:RSI (top half of the logic) — a standard RSI plotted on its usual 0–100 scale, with horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold). Length and source are configurable.
Squeeze PRO (volatility compression) — it compares Bollinger Bands (2 standard deviations) against three Keltner Channel widths (1x, 1.5x, and 2x average true range). Depending on how tightly the Bollinger Bands are nested inside those channels, it classifies the current bar into one of five states, each shown as a colored dot sitting on the RSI's 50-line:
Blue — transitional/no clear squeeze
Yellow — narrow squeeze (tightest compression, most "coiled")
Red — normal squeeze
Black — wide squeeze (loosest compression, but still squeezed)
Green — squeeze released (bands have expanded outward — volatility breakout in progress)
There's also an optional momentum histogram (off by default, toggle "Show MOM Histogram") that shows a linear-regression-based momentum oscillator, similar to the classic squeeze momentum indicator.
RSI Divergence — this scans for pivot highs/lows in the RSI and compares them to price pivots over the same span. When RSI and price disagree, it draws a short line connecting the two RSI pivot points plus a label, directly on the RSI plot:
"Bull" (regular bullish, green) — price made a lower low but RSI made a higher low; potential reversal up
"Bear" (regular bearish, red) — price made a higher high but RSI made a lower high; potential reversal down
"H Bull" / "H Bear" (hidden divergences, dimmer colors, off by default) — typically signal trend continuation rather than reversal
These signals are confirmed lbR bars (default 5) after the actual pivot, which is normal for any divergence tool — it trades a small delay for fewer false signals.
Confluence — the script tracks when a squeeze "fires" (transitions to the green/released state) and checks whether a divergence occurred on that same bar. If both line up, it triggers a separate "Bullish Confluence" or "Bearish Confluence" alert — the idea being that a volatility expansion plus a divergence in the same direction is a stronger combined signal than either alone.
Alerts are set up for every divergence type, for squeeze release on its own, and for the two confluence cases, so you can build alerts off whichever combination matters to you.
Phát hành các Ghi chú
This indicator combines two tools in a single sub-pane below your chart:RSI (top half of the logic) — a standard RSI plotted on its usual 0–100 scale, with horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold). Length and source are configurable.
Squeeze PRO (volatility compression) — it compares Bollinger Bands (2 standard deviations) against three Keltner Channel widths (1x, 1.5x, and 2x average true range). Depending on how tightly the Bollinger Bands are nested inside those channels, it classifies the current bar into one of five states, each shown as a colored dot sitting on the RSI's 50-line:
Blue — transitional/no clear squeeze
Yellow — narrow squeeze (tightest compression, most "coiled")
Red — normal squeeze
Black — wide squeeze (loosest compression, but still squeezed)
Green — squeeze released (bands have expanded outward — volatility breakout in progress)
There's also an optional momentum histogram (off by default, toggle "Show MOM Histogram") that shows a linear-regression-based momentum oscillator, similar to the classic squeeze momentum indicator.
RSI Divergence — this scans for pivot highs/lows in the RSI and compares them to price pivots over the same span. When RSI and price disagree, it draws a short line connecting the two RSI pivot points plus a label, directly on the RSI plot:
"Bull" (regular bullish, green) — price made a lower low but RSI made a higher low; potential reversal up
"Bear" (regular bearish, red) — price made a higher high but RSI made a lower high; potential reversal down
"H Bull" / "H Bear" (hidden divergences, dimmer colors, off by default) — typically signal trend continuation rather than reversal
These signals are confirmed lbR bars (default 5) after the actual pivot, which is normal for any divergence tool — it trades a small delay for fewer false signals.
Confluence — the script tracks when a squeeze "fires" (transitions to the green/released state) and checks whether a divergence occurred on that same bar. If both line up, it triggers a separate "Bullish Confluence" or "Bearish Confluence" alert — the idea being that a volatility expansion plus a divergence in the same direction is a stronger combined signal than either alone.
Alerts are set up for every divergence type, for squeeze release on its own, and for the two confluence cases, so you can build alerts off whichever combination matters to you.
20 hours ago
Release Notes
This indicator combines two tools in a single sub-pane below your chart:
RSI (top half of the logic) — a standard RSI plotted on its usual 0–100 scale, with horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold). Length and source are configurable.
Squeeze PRO (volatility compression) — it compares Bollinger Bands (2 standard deviations) against three Keltner Channel widths (1x, 1.5x, and 2x average true range). Depending on how tightly the Bollinger Bands are nested inside those channels, it classifies the current bar into one of five states, each shown as a colored dot sitting on the RSI's 50-line:
Blue — transitional/no clear squeeze
Yellow — narrow squeeze (tightest compression, most "coiled")
Red — normal squeeze
Black — wide squeeze (loosest compression, but still squeezed)
Green — squeeze released (bands have expanded outward — volatility breakout in progress)
There's also an optional momentum histogram (off by default, toggle "Show MOM Histogram") that shows a linear-regression-based momentum oscillator, similar to the classic squeeze momentum indicator.
RSI Divergence — this scans for pivot highs/lows in the RSI and compares them to price pivots over the same span. When RSI and price disagree, it draws a short line connecting the two RSI pivot points plus a label, directly on the RSI plot:
"Bull" (regular bullish, green) — price made a lower low but RSI made a higher low; potential reversal up
"Bear" (regular bearish, red) — price made a higher high but RSI made a lower high; potential reversal down
"H Bull" / "H Bear" (hidden divergences, dimmer colors, off by default) — typically signal trend continuation rather than reversal
These signals are confirmed lbR bars (default 5) after the actual pivot, which is normal for any divergence tool — it trades a small delay for fewer false signals.
Confluence — the script tracks when a squeeze "fires" (transitions to the green/released state) and checks whether a divergence occurred on that same bar. If both line up, it triggers a separate "Bullish Confluence" or "Bearish Confluence" alert — the idea being that a volatility expansion plus a divergence in the same direction is a stronger combined signal than either alone.
Alerts are set up for every divergence type, for squeeze release on its own, and for the two confluence cases, so you can build alerts off whichever combination matters to you.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.