OPEN-SOURCE SCRIPT
RSI Divergence Confirmation

About This Script
RSI Divergence Confirmation identifies regular and hidden bullish and bearish divergences between price and the Relative Strength Index.
The indicator uses confirmed RSI pivot highs and lows as the anchor points for divergence detection. Price comparisons are based on the candle body, not the wick:
Bullish divergences use the lower body value: min(open, close).
Bearish divergences use the upper body value: max(open, close).
Divergence Types
Regular bullish: Price forms a lower body low while RSI forms a higher low.
Hidden bullish: Price forms a higher body low while RSI forms a lower low.
Regular bearish: Price forms a higher body high while RSI forms a lower high.
Hidden bearish: Price forms a lower body high while RSI forms a higher high.
Confirmation Arrows
A divergence is confirmed only when the first opposite-colored candle appears after the divergence setup:
Bullish divergence requires the first bullish candle.
Bearish divergence requires the first bearish candle.
That candle must have a body strictly larger than the previous candle’s body. If the first opposite candle fails this condition, a later candle cannot replace it.
Visual Features
Solid lines represent regular divergences.
Dashed lines represent hidden divergences.
Divergence lines are displayed on both the price chart and the RSI pane.
Price divergence lines are anchored using candle-body values rather than wick extremes.
Alert conditions are available for confirmed bullish and bearish divergences.
Pivot confirmation introduces a delay based on the selected right-pivot setting. Lower pivot values provide faster but more sensitive signals, while higher values produce fewer and more selective divergences. This indicator is intended as an analytical and alerting tool; it does not place trades.
RSI Divergence Confirmation identifies regular and hidden bullish and bearish divergences between price and the Relative Strength Index.
The indicator uses confirmed RSI pivot highs and lows as the anchor points for divergence detection. Price comparisons are based on the candle body, not the wick:
Bullish divergences use the lower body value: min(open, close).
Bearish divergences use the upper body value: max(open, close).
Divergence Types
Regular bullish: Price forms a lower body low while RSI forms a higher low.
Hidden bullish: Price forms a higher body low while RSI forms a lower low.
Regular bearish: Price forms a higher body high while RSI forms a lower high.
Hidden bearish: Price forms a lower body high while RSI forms a higher high.
Confirmation Arrows
A divergence is confirmed only when the first opposite-colored candle appears after the divergence setup:
Bullish divergence requires the first bullish candle.
Bearish divergence requires the first bearish candle.
That candle must have a body strictly larger than the previous candle’s body. If the first opposite candle fails this condition, a later candle cannot replace it.
Visual Features
Solid lines represent regular divergences.
Dashed lines represent hidden divergences.
Divergence lines are displayed on both the price chart and the RSI pane.
Price divergence lines are anchored using candle-body values rather than wick extremes.
Alert conditions are available for confirmed bullish and bearish divergences.
Pivot confirmation introduces a delay based on the selected right-pivot setting. Lower pivot values provide faster but more sensitive signals, while higher values produce fewer and more selective divergences. This indicator is intended as an analytical and alerting tool; it does not place trades.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน