Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Hello Horserider,Just as a heads up to people that may be using this version of Market Mover. ToS will not correctly display the RSI and SMA in the same study or same chart window if you have added separate RSI and SMA studies as described. If you place them together it will plot but if you go back to beginning of your chart time interval and scroll forward you will see the SMA shift in position relative to RSI. Looks like this can be solved by zooming in to a short part of your chart. The question is how much to zoom. Also now to see the whole chart as it relates to your zoomed area is not possible.
Since ToS presents this scaling problem I am proposing several alternatives to the Market Mover that avoid the scaling difficulty.
The difference in one alternative is the cross is now calculated from only RSI data. It becomes a cross of RSI and RSI average.
![]()
The 5 day 5 minute chart Signal is RSI (white) crosses SMA(cyan). The top study is Market Mover. You can see does not work well when not zoomed.
The second study is simply the Bollinger Band midline(cyan) and a SMA of 1(white)
The third and fourth are RSI and SMA of RSI.
The fourth is MACD and SMA of MACD.
Results of all but Market Mover are very similar.
# MACD colored and MACD Average and Bollinger Bands Midline
# MACD average used as cross of MACD
# Bollinger Bands Midline acting as a MovingAverage average of price cross signal for MACD
# Use both of choose one by unchecking a plot in study settings.
# Horserider by request from Rojo Grande 1/5/2020
declare lower;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input AverageTypeMACD = {SMA, default EMA, HMA, Wilders};
input price = close;
input displace = 0;
def MACD_Data = MACD(fastLength = fastLength, slowLength = slowLength, MACDLength = MACDLength);
plot MACD_Line = MACD_Data;
MACD_Line.DefineColor("Up", Color.GREEN);
MACD_Line.DefineColor("Down", Color.RED);
MACD_Line.DefineColor("Even", Color.WHITE);
MACD_Line.AssignValueColor(if MACD_Line > MACD_Line[1] then MACD_Line.Color("Up") else (if MACD_Line == MACD_Line[1] then MACD_Line.Color("Even") else MACD_Line.Color("Down")));
MACD_Line.SetLineWeight(3);
def Value;
plot Avg;
switch (AverageTypeMACD) {
case SMA:
Value = Average(price, fastLength) - Average(price, slowLength);
Avg = Average(Value, MACDLength);
case EMA:
Value = ExpAverage(price, fastLength) - ExpAverage(price, slowLength);
Avg = ExpAverage(Value, MACDLength);
case HMA:
Value = WMA(2 * WMA(price, fastlength / 2) - WMA( price, slowlength), sqrt(slowlength));
Avg = ExpAverage(Value, MACDLength);
case Wilders:
Value = WildersAverage(price, fastLength) - WildersAverage(price, slowLength);
Avg = ExpAverage(Value, MACDLength);
}
Avg.SetDefaultColor(Color.CYAN);
#plot BB;
input AverageTypeBB = {default SMA, EMA, HMA};
input displaceBB = 0;
input lengthBB = 5;
def midline;
switch (AverageTypeBB) {
case SMA:
midline = reference BollingerBands(MACD_Line, displaceBB, lengthBB ).Midline;
case EMA:
midline = reference BollingerBands(MACD_Line, displaceBB, lengthBB, averageType = AverageType.EXPONENTIAL).Midline;
case HMA:
midline = reference BollingerBands(MACD_Line, displaceBB, lengthBB, averageType = AverageType.HULL).Midline;
}
plot midline1 = midline;
midline1.SetDefaultColor(Color.WHITE);
midline1.SetLineWeight(1);
Thank you BenTen. I am new to scripting. I am learning the script coding and will be soon able to contribute.@kaflesu You can find the oscillator using this link https://usethinkscript.com/threads/moving-average-crossover-rsi-indicator-for-thinkorswim.185/
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
![]() |
Market Structure Trailing Stop [LuxAlgo] for ThinkOrSwim | Indicators | 11 | |
![]() |
Market Bias (CEREBR) Indicator for ThinkOrSwim | Indicators | 15 | |
T | NextSignal's Market Volume Profile For ThinkOrSwim | Indicators | 16 | |
F | Tea 2.0 - Market Cycle Indicator For ThinkOrSwim | Indicators | 12 | |
S | System Market Intraday Setup for ThinkorSwim | Indicators | 4 |
Start a new thread and receive assistance from our community.
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.
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.