God Mode + RSI Scan?

TDTOS

Member
hello,
Combined the God Mode: https://usethinkscript.com/threads/god-mode-indicator-for-thinkorswim.9958/
with the RSI.

I keep getting a "too complex" error when I try and use this as a scanner. If anyone is able to help, that would be much appreciated! Thanks!

Ruby:
declare lower;
# Gmode

def lengthRSI = 14;
def price = close;

input averageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(averageType, price - price[1], lengthRSI);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), lengthRSI);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

plot RSI = 50 * (ChgRatio + 1);
RSI.SetDefaultColor(CreateColor(0, 102, 204));
RSI.SetLineWeight(3);
#RSI.HideTitle();
RSI.HideBubble();
RSI.Hide();

#// Tradingview.com
#// @author LazyBear, xSilas, Ni6HTH4wK, SNOW_CITY
#// SNOW_CITY Remove BTCe added BITSTAMP, #Changed default varibles USE ON 1m, 5M, 15M charts
#study(title="Godmode3.1")

#----------------- God Mode VariableMA 3.1.4 ------------------#
#------------- Translated for TOS by Syracusepro --------------#

input n1 = 9; #Channel Length
input n2 = 26; #Average Length
input n3 = 13; #Short length
def multi = no; #Multi-exchange?

def src0 = hlc3;

def src1 = hlc3(period = AggregationPeriod.MONTH);
def src2 = hlc3(period = AggregationPeriod.MONTH);
def src3 = hlc3(period = AggregationPeriod.MONTH);
def src4 = hlc3(period = AggregationPeriod.MONTH);

script tci {

input src = hlc3;
input n1 = 9; #Channel Length
input n2 = 26; #Average Length
plot tci = MovAvgExponential((src - MovAvgExponential(src, n1)) / (0.025 * MovAvgExponential(AbsValue(src - MovAvgExponential(src, n1)), n1)), n2) + 50;
tci.Hide();
}

#mf(src) => rsi(sum(volume * (change(src) <= 0 ? 0 : src), n3), sum(volume * (change(src) >= 0 ? 0 : src), n3))

script mf {

input src = hlc3;
input n3 = 13; #Short length

def rsi = reference RSI();

#plot mf = rsi(Sum(volume * (if Average(src) <= 0 then 0 else src), n3), Sum(volume * (if Average(src) >= 0 then 0 else src), n3));
plot mf = RSI(n3, src);
mf.Hide();
}

script willy {

input src = hlc3;
input n2 = 26; #Average Length
plot willy = 60 * (src - Highest(src, n2)) / (Highest(src, n2) - Lowest(src, n2)) + 80;
willy.Hide();

}

#csi(src) => avg(rsi(src, n3),tsi(src0,n1,n2)*50+50)

script csi {

input src = hlc3;
input n1 = 9; #Channel Length
input n2 = 26; #Average Length
input n3 = 13; #Short length

def rsi = reference RSI();

plot csi = RSI(n3, src) + TrueStrengthIndex(n1, n2) / 2 * 50 + 50;
csi.Hide();

}

script godmode {

input src = hlc3;
def rsi = reference RSI();
plot godmode = (tci(src) + CSI(src) + mf(src) + willy(src)) / 4;
godmode.Hide();

}

script tradition {

input src = hlc3;
input n3 = 13; #Short length

def rsi = reference RSI();

plot tradition = (tci(src) + mf(src) + RSI(n3, src)) / 3;
tradition.Hide();

}

def wt1 = if multi then (godmode(src0) + godmode(src1) + godmode(src2) + godmode(src3) + godmode(src4) / 5) else tradition(src0);

def wt2 = SimpleMovingAvg(wt1, 6);

def extended = if wt2 < 20 then wt2 + 5 else if wt2 > 80 then wt2 - 5 else Double.NaN;

plot wta = wt1;
wta.SetDefaultColor(Color.GREEN);
wta.SetLineWeight(2);
wta.Hide();

plot wtb = wt2;
wtb.SetDefaultColor(Color.RED);
wtb.SetLineWeight(2);
wtb.Hide();

plot ext = extended; #Caution!
ext.SetPaintingStrategy(PaintingStrategy.POINTS);
ext.SetDefaultColor(Color.YELLOW);
ext.SetLineWeight(3);

# PercentR_MAC

input length = 14;
input over_Bought = 80;
input over_Sold = 20;
input showBreakoutSignals = yes;
input PercentRMALength5 = 5; #hint rsiMALength: RSI Moving Average Length
input PercentRMALength8 = 8;
input PercentRAverageType = AverageType.EXPONENTIAL;
input applySmoothing = yes; #Smooth PercentR?
input lowBand = 10; #Smoothing LowerBand
input data = close;
input lower = low; #Research Lower = Low?

def highest = Highest(high, Length);
def divisor = highest - Lowest(low, Length);

def PI = 3.14159265359;
def a1 = Exp(-PI * Sqrt(2) / lower);
def coeff2 = 2 * a1 * Cos(Sqrt(2) * PI / lower);
def coeff3 = - Power(a1, 2);
def coeff1 = 1 - coeff2 - coeff3;
def filt = coeff1 * (data + (data[1])) / 2 + coeff2 * (filt[1]) + coeff3 * (filt[2]);
def rough_it = if divisor equals 0 then 0 else (100 - 100 * (highest - close) / divisor);

# plot and smooth PercentR
plot "%R" = if applySmoothing then EhlersSuperSmootherFilter(if divisor equals 0 then 0 else 100 - 100 * (highest - close) / divisor, LowBand) else rough_it;
"%R".DefineColor("OverBought", GetColor(9));
"%R".DefineColor("Normal", GetColor(7));
"%R".DefineColor("OverSold", GetColor(1));
"%R".AssignValueColor(if "%R" > over_Bought then "%R".Color("OverBought") else if "%R" < over_Sold then "%R".Color("OverSold") else "%R".Color("Normal"));
"%R".SetLineWeight(3);

# plot the PercentR Moving Averages
def PercentRMA5 = MovingAverage(PercentRAverageType, "%R", PercentRMALength5);
plot PercentRMovAvg5 = PercentRMA5;
PercentRMovAvg5.SetDefaultColor(Color.GREEN);
PercentRMovAvg5.SetLineWeight(3);

def PercentRMA8 = MovingAverage(PercentRAverageType, "%R", PercentRMALength8);
plot PercentRMovAvg8 = PercentRMA8;
PercentRMovAvg8.SetDefaultColor(Color.RED);
PercentRMovAvg8.SetLineWeight(3);

plot OverBought = over_Bought;
OverBought.SetDefaultColor(Color.DARK_RED);
OverBought.HideTitle();

plot OverSold = over_Sold;
OverSold.SetDefaultColor(Color.DARK_GREEN);
OverSold.HideTitle();

plot fifty_line = 50;
fifty_line.SetDefaultColor(GetColor(8));
fifty_line.HideTitle();
fifty_line.SetStyle(Curve.SHORT_DASH);

# plot the Breakout Signals
plot UpSignal = if "%R" crosses above OverSold then OverSold else Double.NaN;
UpSignal.SetHiding(!showBreakoutSignals);
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
UpSignal.SetLineWeight(3);
UpSignal.HideTitle();

plot DownSignal = if "%R" crosses below OverBought then OverBought else Double.NaN;
DownSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
DownSignal.SetLineWeight(3);
DownSignal.HideTitle();

AddCloud(0, over_Sold, Color.DARK_GREEN, Color.DARK_GREEN);
AddCloud(over_Bought, 100, Color.DARK_RED, Color.DARK_RED);
 
Last edited by a moderator:
Solution
Unfortunately, the God Mode script was too complex before you add the RSI logic.
While no script is "too complex" to plot on the chart;
Schwab does throttle the use of complex scripts in scans, watchlists, and conditional orders to prevent high load runs on its servers.

No, this indicator cannot be used in Scans, Watchlists, Conditional Orders or any other ToS widget.
Unfortunately, the God Mode script was too complex before you add the RSI logic.
While no script is "too complex" to plot on the chart;
Schwab does throttle the use of complex scripts in scans, watchlists, and conditional orders to prevent high load runs on its servers.

No, this indicator cannot be used in Scans, Watchlists, Conditional Orders or any other ToS widget.
 
Last edited by a moderator:
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
193 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