OPEN-SOURCE SCRIPT
업데이트됨 RvDiv Regular Divergence (Daily)

Rv-Div — Regular Divergence (Daily)
Rv-Div marks confirmed regular divergences on the daily chart and draws the line that connects them, so you can see the structure the signal is based on instead of trusting an arrow.
**What it does**
A bullish divergence is price making a lower low while the oscillator makes a higher low: price is still falling, but with less force behind it. A bearish divergence is the mirror image — a higher high in price against a lower high in the oscillator.
Rv-Div marks the exact candle that confirms the divergence, draws the line between the two pivots it used, and can fire an alert.
**The problem it solves**
Most divergence tools compare each new pivot against the immediately previous one. That works until a small wrinkle appears between the two lows that actually matter — and then the line gets drawn between the wrinkle and the new low instead of between the two real lows. The divergence you see on screen is not the one your eye would have drawn.
Rv-Div compares each new pivot against the last N pivots, not just the previous one, and keeps the one that forms a valid divergence. That is what the eye does: connect the two lows that matter, skipping the noise in between.
It also spends each anchor. Without that, one old pivot gets reused against every new pivot that appears, and you end up with several lines fanning out from the same point — the same divergence counted three or four times, which inflates any count you make of them. Here, once an anchor is used it is discarded along with everything older.
**Quality filters**
Not every pair of pivots deserves to be called a divergence. Four filters, all adjustable:
- Minimum price difference between the two extremes, measured in ATR, so it travels across symbols and volatility regimes instead of using a fixed percentage.
- Minimum difference between the two oscillator pivots.
- Both oscillator pivots on the correct side of zero.
- Minimum and maximum bar separation between the two pivots.
**Settings**
Three oscillators to choose from — Awesome Oscillator, MACD histogram, and a linear-regression momentum. All three are public-domain formulas.
The pivot definition (bars to the left and right), the quality filters, the two EMAs, the colours, the label size and the line width are all adjustable. The default values are the ones I use on the daily chart.
**How to use it**
Daily chart only. The indicator says so on screen if you load it on any other timeframe.
Set alerts to **Once per bar close**. A forming candle keeps changing until it closes, and a divergence is not confirmed until then.
**Dropping to a lower timeframe to confirm**
The signal is a daily signal, but you do not have to take it blind on the daily close. Once the daily marks the entry, drop to 4h and wait for a break of the local high followed by a pullback — or go from 4h down to 1h and look for the same thing. You give up a little of the move in exchange for not entering into a candle that is still falling.
This is deliberately not built into the indicator. It is a judgement call, and judgement calls belong to the trader, not to a script that has to work the same way on every symbol and every market.
**What it does not do**
It does not manage exits. It marks an entry candle and nothing else — no targets, no stops, no position sizing. Those decisions are yours.
It is not a standalone system. A divergence tells you that momentum is fading, not that the trend has turned. What you do with that information is where your own judgement goes.
**About the confirmation delay**
A pivot does not exist until the required bars have closed to its right, so the signal arrives with that delay. This is deliberate. Removing it would mean signalling on unconfirmed pivots, which look excellent in hindsight and vanish in real time.
Historical signals do not repaint: once a pivot is confirmed, it stays confirmed. The forming candle is the only thing that can change, which is why alerts should be set to bar close.
---
**Español**
Rv-Div marca divergencias regulares confirmadas en gráfico diario y dibuja la línea que las une, para que veas la estructura en la que se apoya la señal en lugar de fiarte de una flecha.
Una divergencia alcista es el precio haciendo un mínimo más bajo mientras el oscilador hace un mínimo más alto: sigue cayendo, pero con menos fuerza detrás. La bajista es la imagen espejo.
La diferencia con la mayoría de detectores de divergencia está en el trazado. Casi todos comparan cada pivote nuevo con el inmediatamente anterior, y en cuanto aparece una arruga entre los dos suelos que de verdad importan, la línea sale mal dibujada. Rv-Div compara contra los últimos N pivotes y se queda con el que forma la divergencia válida — que es lo que hace el ojo. Además consume cada ancla, así que un mismo pivote antiguo no se reutiliza una y otra vez generando varias líneas en abanico desde el mismo punto.
Cuatro filtros de calidad ajustables (diferencia mínima de precio en ATR, diferencia mínima del oscilador, ambos pivotes del lado correcto del cero, y separación mínima y máxima), tres osciladores a elegir, y todo el aspecto configurable.
Solo diario. Alertas configuradas como "Una vez por barra al cerrar".
**Bajar a una temporalidad menor para confirmar.** La señal es del diario, pero no hace falta tomarla a ciegas en el cierre diario. Cuando el diario marca la entrada, se puede bajar a 4h y esperar una ruptura del máximo local con su retroceso — o de 4h bajar a 1h y buscar lo mismo. Se cede un poco del movimiento a cambio de no entrar en una vela que todavía viene cayendo. Esto no está metido en el indicador a propósito: es criterio del operador, y el criterio no se le delega a un script que tiene que funcionar igual en todos los símbolos.
No gestiona salidas ni es un sistema completo: marca la vela de entrada y nada más. Una divergencia dice que el impulso se está agotando, no que la tendencia ya giró.
El retraso de confirmación es deliberado: un pivote no existe hasta que cierran las velas que lleva a su derecha. Quitarlo significaría señalar sobre pivotes sin confirmar, que se ven perfectos en el pasado y desaparecen en vivo. Las señales históricas no repintan.
Rv-Div marks confirmed regular divergences on the daily chart and draws the line that connects them, so you can see the structure the signal is based on instead of trusting an arrow.
**What it does**
A bullish divergence is price making a lower low while the oscillator makes a higher low: price is still falling, but with less force behind it. A bearish divergence is the mirror image — a higher high in price against a lower high in the oscillator.
Rv-Div marks the exact candle that confirms the divergence, draws the line between the two pivots it used, and can fire an alert.
**The problem it solves**
Most divergence tools compare each new pivot against the immediately previous one. That works until a small wrinkle appears between the two lows that actually matter — and then the line gets drawn between the wrinkle and the new low instead of between the two real lows. The divergence you see on screen is not the one your eye would have drawn.
Rv-Div compares each new pivot against the last N pivots, not just the previous one, and keeps the one that forms a valid divergence. That is what the eye does: connect the two lows that matter, skipping the noise in between.
It also spends each anchor. Without that, one old pivot gets reused against every new pivot that appears, and you end up with several lines fanning out from the same point — the same divergence counted three or four times, which inflates any count you make of them. Here, once an anchor is used it is discarded along with everything older.
**Quality filters**
Not every pair of pivots deserves to be called a divergence. Four filters, all adjustable:
- Minimum price difference between the two extremes, measured in ATR, so it travels across symbols and volatility regimes instead of using a fixed percentage.
- Minimum difference between the two oscillator pivots.
- Both oscillator pivots on the correct side of zero.
- Minimum and maximum bar separation between the two pivots.
**Settings**
Three oscillators to choose from — Awesome Oscillator, MACD histogram, and a linear-regression momentum. All three are public-domain formulas.
The pivot definition (bars to the left and right), the quality filters, the two EMAs, the colours, the label size and the line width are all adjustable. The default values are the ones I use on the daily chart.
**How to use it**
Daily chart only. The indicator says so on screen if you load it on any other timeframe.
Set alerts to **Once per bar close**. A forming candle keeps changing until it closes, and a divergence is not confirmed until then.
**Dropping to a lower timeframe to confirm**
The signal is a daily signal, but you do not have to take it blind on the daily close. Once the daily marks the entry, drop to 4h and wait for a break of the local high followed by a pullback — or go from 4h down to 1h and look for the same thing. You give up a little of the move in exchange for not entering into a candle that is still falling.
This is deliberately not built into the indicator. It is a judgement call, and judgement calls belong to the trader, not to a script that has to work the same way on every symbol and every market.
**What it does not do**
It does not manage exits. It marks an entry candle and nothing else — no targets, no stops, no position sizing. Those decisions are yours.
It is not a standalone system. A divergence tells you that momentum is fading, not that the trend has turned. What you do with that information is where your own judgement goes.
**About the confirmation delay**
A pivot does not exist until the required bars have closed to its right, so the signal arrives with that delay. This is deliberate. Removing it would mean signalling on unconfirmed pivots, which look excellent in hindsight and vanish in real time.
Historical signals do not repaint: once a pivot is confirmed, it stays confirmed. The forming candle is the only thing that can change, which is why alerts should be set to bar close.
---
**Español**
Rv-Div marca divergencias regulares confirmadas en gráfico diario y dibuja la línea que las une, para que veas la estructura en la que se apoya la señal en lugar de fiarte de una flecha.
Una divergencia alcista es el precio haciendo un mínimo más bajo mientras el oscilador hace un mínimo más alto: sigue cayendo, pero con menos fuerza detrás. La bajista es la imagen espejo.
La diferencia con la mayoría de detectores de divergencia está en el trazado. Casi todos comparan cada pivote nuevo con el inmediatamente anterior, y en cuanto aparece una arruga entre los dos suelos que de verdad importan, la línea sale mal dibujada. Rv-Div compara contra los últimos N pivotes y se queda con el que forma la divergencia válida — que es lo que hace el ojo. Además consume cada ancla, así que un mismo pivote antiguo no se reutiliza una y otra vez generando varias líneas en abanico desde el mismo punto.
Cuatro filtros de calidad ajustables (diferencia mínima de precio en ATR, diferencia mínima del oscilador, ambos pivotes del lado correcto del cero, y separación mínima y máxima), tres osciladores a elegir, y todo el aspecto configurable.
Solo diario. Alertas configuradas como "Una vez por barra al cerrar".
**Bajar a una temporalidad menor para confirmar.** La señal es del diario, pero no hace falta tomarla a ciegas en el cierre diario. Cuando el diario marca la entrada, se puede bajar a 4h y esperar una ruptura del máximo local con su retroceso — o de 4h bajar a 1h y buscar lo mismo. Se cede un poco del movimiento a cambio de no entrar en una vela que todavía viene cayendo. Esto no está metido en el indicador a propósito: es criterio del operador, y el criterio no se le delega a un script que tiene que funcionar igual en todos los símbolos.
No gestiona salidas ni es un sistema completo: marca la vela de entrada y nada más. Una divergencia dice que el impulso se está agotando, no que la tendencia ya giró.
El retraso de confirmación es deliberado: un pivote no existe hasta que cierran las velas que lleva a su derecha. Quitarlo significaría señalar sobre pivotes sin confirmar, que se ven perfectos en el pasado y desaparecen en vivo. Las señales históricas no repintan.
릴리즈 노트
Labels renamed to div-buy and div-sell.They used to say BUY and SELL, which collides with every other
entry indicator on the chart. Now the label tells you which tool
it came from without you having to remember the colour.
The wait between signals is now per direction.
Before, one counter was shared: a sell would block a buy for the
next N bars. That is wrong. A buy right after a sell is what
happens at a real turn, and it was being hidden. Buys and sells
now have separate counters.
Divergence lines are off by default.
The setting is still there. It just no longer paints the chart
before you have decided you want it.
Default settings updated to the ones I actually use.
Pivot right 2, minimum separation 4, compare against the last 12
pivots, keep the widest structure, wait 3 bars. If you already
have the indicator on a chart, your own settings are kept. This
only affects new installs.
릴리즈 노트
BTC-Divergence D1오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.