RicardoSantos

[RS]RSI Divergence V3

EXPERIMENTAL: using reflections / mirrors to pinpoint reversal points and zones on a rising/falling aglomeration.
default is turned off, needs to be turned on in the options.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
study(title="RSI Divergence V3", shorttitle="RSID.V3", overlay=false)
hidemirrors = input(true)
buylimit = input(40)
selllimit = input(60)

source = close

rsi1 = rsi(source, input(14))
rsi2 = rsi(source, input(50))
//  ||---
excess = rsi2-rsi1
posexcess = excess > 0 ? buylimit-excess : buylimit
negexcess = excess < 0 ? selllimit-excess : selllimit

plot(posexcess, style=area, color=orange, histbase=buylimit)
plot(negexcess, style=area, color=olive, histbase=selllimit)
//  ||---   Mirroring
posmirror = excess > 0 ? 0+excess : 0
negmirror = excess < 0 ? 100+excess : 100
posmirror1 = excess > 0 ? 0+excess*2 : 0
negmirror1 = excess < 0 ? 100+excess*2 : 100
posmirror2 = excess > 0 ? 0+excess*4 : 0
negmirror2 = excess < 0 ? 100+excess*4 : 100
plot(hidemirrors ? na : posmirror, style=area, color=olive, transp=45, histbase=0)
plot(hidemirrors ? na : negmirror, style=area, color=orange, transp=45, histbase=100)
plot(hidemirrors ? na : posmirror1, style=area, color=olive, transp=60, histbase=0)
plot(hidemirrors ? na : negmirror1, style=area, color=orange, transp=60, histbase=100)
plot(hidemirrors ? na : posmirror2, style=area, color=olive, transp=75, histbase=0)
plot(hidemirrors ? na : negmirror2, style=area, color=orange, transp=75, histbase=100)

//  ||---   Outputs
//  ||---   This need to be last to show on top.
plot(rsi1, color=#98b8be, style=histogram, linewidth=2, histbase=50)
plot(rsi2, color=#be9e98, style=histogram, linewidth=2, histbase=50)

plot(rsi1, color=black, style=line, linewidth=1)
plot(rsi2, color=black, style=line, linewidth=1)

hline(buylimit, color=green)
hline(selllimit, color=maroon)

Comments



This might be better represented as a candlestick overlay indicator. Green Candlestick bullish trend, red candlestick bearish trend.
+3 Reply
I'm still a bit puzzled by this one...:D
+2 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter