RSI + ROC + MACD + CCI + STOCHK For ThinkOrSwim

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

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
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
291 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top