Would someone please transfer this
RSI++ into thinkscript?
https://pastebin.com/SGurSgUG
Code:
//
// @author LazyBear
// If you use this code in its original or modified form, do drop me a PM. Thanks.
//
study(title="RSI++ [LazyBear]")
lengthRSI=input(25)
lengthROC=input(25)
src=close
overbought=input(0)
oversold=input(0)
fastMACDLength=input(10)
slowMACDLength=input(21)
lengthCCI = input(50)
lengthStoch=input(14)
smoothK=input(3)
macd(source, fastLength, slowLength) =>
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
fastMA - slowMA
acc=(rsi(src , lengthRSI) +
roc(src , lengthROC) +
macd(src, fastMACDLength, slowMACDLength) +
cci(src, lengthCCI) +
sma(stoch(close, high, low, lengthStoch), smoothK)) / 5.0
acc_ob=acc>overbought
acc_os=acc<oversold
plot(acc , color=acc_ob?red : acc_os?green : white , linewidth=1)
not pro, but something I tried.
#//
#// @author LazyBear
#// If you use this code in its original or modified form, do drop me a PM. Thanks.
#//
#study(title="RSI++ [LazyBear]")
# Converted by SAM4COK --- Added deadzone from WAE indicator --
declare lower;
input lengthRSI = 25;
input lengthROC = 25;
input lengthCCI = 50;
input source = hlc3;
input Filter = 0.5;
input fastMACDLength = 10;
input slowMACDLength = 21;
input lengthStoch = 14;
input smoothK = 3;
DefineGlobalColor("Bullish", Color.DARK_GREEN);
DefineGlobalColor("Bearish", Color.DARK_RED);
def na = Double.NaN;
def ROC = (source - source[lengthROC]) / source[lengthROC] * 100;
def fastMA = ExpAverage(source, fastMACDLength);
def slowMA = ExpAverage(source, slowMACDLength);
def MACD = fastMA - slowMA;
def StocK = reference StochasticFull(Filter, -Filter, lengthStoch, smoothK, high, low, close, 1).FullK;
def NetChgAvg = ExpAverage(source - source[1], lengthRSI);
def TotChgAvg = ExpAverage(AbsValue(source - source[1]), lengthRSI);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);
def CCI = CCI(lengthCCI);
Plot ZeroLine = 0;
ZeroLine.SetStyle(Curve.SHORT_DASH);
ZeroLine.AssignValueColor(Color.Dark_GRAY);
def DeadZone = WildersAverage(TrueRange(high, close, low),100) * 3.7; #"DeadZoneLine"
plot acc = (RSI + ROC + MACD + CCI + StocK) / 5.0;
Plot OB = Filter + DeadZone;
Plot OS = - Filter - DeadZone;
def acc_ob = acc > OB;
def acc_os = acc < OS;
acc.SetStyle(Curve.FIRM);
acc.SetLineWeight(3);
acc.AssignValueColor(if acc_ob then GlobalColor("Bullish") else if acc_os then GlobalColor("Bearish") else Color.Gray);
OB.SetStyle(Curve.MEDIUM_DASH);
OB.AssignValueColor(Color.GRAY);
OS.SetStyle(Curve.MEDIUM_DASH);
OS.AssignValueColor(Color.GRAY);
### End Code