Code: Select all
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © fikira
// ≠ ≈ ◊ ~ ∞ ‡ ∂ ƒ ¬ π º † • ∏ ª Ω ∑ ∆ · | \ ı ∫ √
//@version=4
study(title="[fikira] RDSI", shorttitle="RDSI", overlay=false)
// Relative Double Strength Index
lnW = input(3 , title="RDSI Length W" )
lnD = input(8 , title="RDSI Length D" )
ln12 = input(17 , title="RDSI Length 12h" )
ln4 = input(36 , title="RDSI Length 4h" )
ln1 = input(313 , title="RDSI Length 1h" )
choice = input("WMA", title="XMA", options=["SMA", "EMA", "WMA", "VWMA", "RMA", "HullMA"])
xma(source, len) =>
choice == "SMA" ? sma(source,len) :
choice == "EMA" ? ema(source,len) :
choice == "WMA" ? wma(source,len) :
choice == "VWMA" ? vwma(source,len) :
choice == "RMA" ? rma(source,len) :
wma(2 * wma(source, floor(len / 2)) - wma(source, len), round(sqrt(len)))
rs =
timeframe.period == "60" ? rsi(close, ln1 ) :
timeframe.period == "240" ? rsi(close, ln4 ) :
timeframe.period == "720" ? rsi(close, ln12) :
timeframe.period == "D" ? rsi(close, lnD ) :
timeframe.period == "W" ? rsi(close, lnW ) :
rsi(close, ln12)
Rup = 0.0
Rdn = 0.0
rsiDiff = rs - rs[1]
Rup := rsiDiff < 0 ? 0 : rsiDiff
Rdn := rsiDiff > 0 ? 0 : rsiDiff
//plot(Rup, color=color.lime, title="Rup")
//plot(Rdn, color=color.red , title="Rdn")
sUp =
timeframe.period == "240" ? xma(Rup, ln4 ) :
timeframe.period == "720" ? xma(Rup, ln12) : xma(Rup, lnD)
sDn =
timeframe.period == "240" ? -xma(Rdn, ln4 ) :
timeframe.period == "720" ? -xma(Rdn, ln12) : -xma(Rdn, lnD)
up = plot(sUp, color=sUp > sDn ? #00fff9 : color.new(#00fff9, 50), title="RDSI up" ) // #00fff9 #004d40
dn = plot(sDn, color=sUp > sDn ? color.new(#e40505, 50) : #e40505, title="RDSI down") // #880e4f #e40505
fill(up, dn, color=sUp > sDn ? #00fff9 : #e40505)
// up = change(rs)
// down = -change(rs)
kvak, mrtools, I was wondering if you would be able to convert this indicator from TradingView into MT4 format. I wasn't sure if it would have been better to place this in the thread for RSI indicators or the thread for MT4 indicator requests.
Either way, the RDSI caught my attention at first glance because it looks surprisingly similar to
I mentioned a few months ago.
I'd be curious to see if RDSI is better or worse than BSP when it comes to entering trades earlier, staying in trends longer, and/or exiting trades at a more optimal time. Especially on Renko charts as I haven't found anything better than BSP for milking all the movement out of a strongly trending market.
If I was able to make a list of additional features to add to this indicator, it would be the ones below: