Smart Divergence Engine Overlay [ChartNation]

This overlay projects the Smart Divergence Engine’s confirmed RSI divergences directly on the price chart. It draws compact lines between swing points and optional BUY/SELL labels anchored to the exact pivot candles, so the signals stick to the candles when you zoom or pan.
It uses the same internal engine as the panel version (smoothed RSI + stdev bands + pivot logic) but renders the result where most traders act—on price.
How it works
- RSI engine. RSI is lightly smoothed, then a 34-period SMA with stdev bands frames regime/volatility context.
- Pivot confirmation. Swings are defined by Pivot Left/Right. On the bar where a pivot confirms (after Pivot Right bars), the script compares price vs RSI at that pivot bar (rsi[pivotR]).
- Bullish divergence: price lower low, RSI higher low.
- Bearish divergence: price higher high, RSI lower high.
- Overlay rendering. Lines are created between the two most recent confirmed pivots using bar indices, so drawings remain perfectly anchored to the candles.
Why this is useful
You get structure-true divergences (only after a swing is confirmed), drawn on price for immediate confluence with S/R, patterns, and candle context—no guesswork mapping from an oscillator pane.
Inputs (key)
- Price Source, RSI Length (14)
- Band Length (34), Band Multiplier (1.618)
- Overbought / Oversold (68/32) – for internal offsets
- Pivot Left / Right (10/10) – swing definition and confirmation delay
- Show lines / Show labels, Line width, Bull/Bear colors
Visuals
Lines connecting the two pivots that form the divergence.
Optional BUY/SELL labels placed at the confirming pivot candle.
Alerts
- Use these for automation or notifications:
- Bullish Divergence (Overlay)
- Bearish Divergence (Overlay)
How to use (practical)
- Treat each printed divergence as context, then align with price action: break/retest, key levels, higher-timeframe bias.
- In strong trends, counter-trend divergences are weaker—wait for structure shifts (e.g., HH/HL after a bull div, LH/LL after a bear div).
Notes & limitations
Signals appear after Pivot Right bars—this ties them to confirmed structure and prevents historical updating.
This is a price overlay only. If you want band/RSI context, pair it with the panel.
仅限邀请脚本
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact chartnation directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
作者的说明
免责声明
仅限邀请脚本
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact chartnation directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.