Normalized Scale TMO w/ RSI Candles For ThinkOrSwim

rlohmeyer

Active member
Though I do not want to add to any confusion about uses for TMO, I liked the indicator and wanted to compare it's behavior directly with RSI. I felt together they might add to scalping a (1 minute) set up that needs quick decisions. This indicator may add something to the decision process with a quick glance. Below is a chart with the indicator in the lower panel.

The chart is a 1 minute chart I scalped Friday for a high average daily range stock (use several different stocks for this type of scalping). The chart has explanations for what is on the chart. The indicator is the TMO in yellow, and RSI candles in Cyan, on a normalized scale. The are both using the close as the data set, both are set to 5 as the number of data points, and both are smoothed by a Wilders Average, TMO 5 and RSI 2. I like the way this indicator adds to the decision whether I am going to place a short or long bet for a scalp at a pullback area. And in the 2 instances on the chart it only took a quick glance to confirm which choice. I share the indicator if any one wants to fool around with it.

Shout out to @BenTen for the TMO posting. @markos for contributions and @germanburrito for the idea to use RSI candles. If BenTen feels this post should be moved to another thread, my feelings won't be hurt.

Chart is below. Code is below chart.

PnaWeN6.jpg


Code:
# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
# hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.#RSI,TMO on_volume normalized scale
# RSI as Candles
# Mobius
# German Burrito mods
#rlohmeyer normalization of scales to compare indicators
declare lower;
#Scale Normaliztion Script
script normalizePlot {
    input normalize_data = close;
    input MinRng = -1;
    input MaxRng = 1;
    def HH = HighestAll( normalize_data );
    def LL = LowestAll( normalize_data );
    plot NR = ((( MaxRng - MinRng ) * ( normalize_data - LL )) / ( HH - LL )) + MinRng;
}

#TMO data
input Tmo_Price = close;
input Tmo_data_length = 10;
input Tmo_Ema_Length = 5;
def o = open;
def TMOdata = fold i = 0 to TMO_data_length with s do s + (if TMO_price > getValue(o, i)
       then 1 else if TMO_price < getValue(o, i)    then - 1 else 0);
def TMOavg = MovingAverage(AverageType.WILDERS,TMOdata, TMO_EMA_Length);

#RSI data
input RSI_price = close;
def RSI_Average = AverageType.WILDERS;
input RSI_Avg_Length = 2;
def NetChgAvg = MovingAverage(RSI_Average, RSI_price - RSI_price[1], RSI_Avg_Length);
def TotChgAvg = MovingAverage(RSI_Average, AbsValue(RSI_price - RSI_price[1]), RSI_Avg_Length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RS = 50 * (ChgRatio + 1);
input Rsi_Ema_Length = 2;
def RSIavg =  ExpAverage(RS, RSI_EMA_Length);

#Scale parameters
input MaxRng = 100;#Max range value
input MinRng = 0;#Min range value
input OBH = 95;
input OBL = 90;
Addcloud(OBH,OBL,color.green);
input OSH = 10;
input OSL = 5;
Addcloud(OSH,OSL,color.red);

#Scale normalization based on parameters
def newTMO = normalizePlot(TMOavg, MinRng, MaxRng );
def newRSI = normalizePlot(RSIavg, MinRng, MaxRng );

#Plot TMO
plot TMO = newTMO;
TMO.setdefaultColor(color.yellow);
TMO.Hidebubble();
TMO.hidetitle();

#Plot RSI Chart
def h = Max(newRSI, newRSI[1]);
def l = Min(newRSI, newRSI[1]);
def c = newRSI;
def op = c[1];
AddChart(high = h, low = l, open = op, close = c, type = ChartType.CANDLE, Color.cyan);

#Midrange
plot Mid = (MaxRng + MinRng)/2;
Mid.setdefaultColor(color.light_gray);
Mid.hidebubble();
Mid.hidetitle();
 

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

Though I do not want to add to any confusion about uses for TMO, I liked the indicator and wanted to compare it's behavior directly with RSI. I felt together they might add to scalping a (1 minute) set up that needs quick decisions. This indicator may add something to the decision process with a quick glance. Below is a chart with the indicator in the lower panel.

The chart is a 1 minute chart I scalped Friday for a high average daily range stock (use several different stocks for this type of scalping). The chart has explanations for what is on the chart. The indicator is the TMO in yellow, and RSI candles in Cyan, on a normalized scale. The are both using the close as the data set, both are set to 5 as the number of data points, and both are smoothed by a Wilders Average, TMO 5 and RSI 2. I like the way this indicator adds to the decision whether I am going to place a short or long bet for a scalp at a pullback area. And in the 2 instances on the chart it only took a quick glance to confirm which choice. I share the indicator if any one wants to fool around with it.

Shout out to @BenTen for the TMO posting. @markos for contributions and @germanburrito for the idea to use RSI candles. If BenTen feels this post should be moved to another thread, my feelings won't be hurt.

Chart is below. Code is below chart.

View attachment 10431

Code:
# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
# hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.#RSI,TMO on_volume normalized scale
# RSI as Candles
# Mobius
# German Burrito mods
#rlohmeyer normalization of scales to compare indicators
declare lower;
#Scale Normaliztion Script
script normalizePlot {
    input normalize_data = close;
    input MinRng = -1;
    input MaxRng = 1;
    def HH = HighestAll( normalize_data );
    def LL = LowestAll( normalize_data );
    plot NR = ((( MaxRng - MinRng ) * ( normalize_data - LL )) / ( HH - LL )) + MinRng;
}

#TMO data
input Tmo_Price = close;
input Tmo_data_length = 10;
input Tmo_Ema_Length = 5;
def o = open;
def TMOdata = fold i = 0 to TMO_data_length with s do s + (if TMO_price > getValue(o, i)
       then 1 else if TMO_price < getValue(o, i)    then - 1 else 0);
def TMOavg = MovingAverage(AverageType.WILDERS,TMOdata, TMO_EMA_Length);

#RSI data
input RSI_price = close;
def RSI_Average = AverageType.WILDERS;
input RSI_Avg_Length = 2;
def NetChgAvg = MovingAverage(RSI_Average, RSI_price - RSI_price[1], RSI_Avg_Length);
def TotChgAvg = MovingAverage(RSI_Average, AbsValue(RSI_price - RSI_price[1]), RSI_Avg_Length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RS = 50 * (ChgRatio + 1);
input Rsi_Ema_Length = 2;
def RSIavg =  ExpAverage(RS, RSI_EMA_Length);

#Scale parameters
input MaxRng = 100;#Max range value
input MinRng = 0;#Min range value
input OBH = 95;
input OBL = 90;
Addcloud(OBH,OBL,color.green);
input OSH = 10;
input OSL = 5;
Addcloud(OSH,OSL,color.red);

#Scale normalization based on parameters
def newTMO = normalizePlot(TMOavg, MinRng, MaxRng );
def newRSI = normalizePlot(RSIavg, MinRng, MaxRng );

#Plot TMO
plot TMO = newTMO;
TMO.setdefaultColor(color.yellow);
TMO.Hidebubble();
TMO.hidetitle();

#Plot RSI Chart
def h = Max(newRSI, newRSI[1]);
def l = Min(newRSI, newRSI[1]);
def c = newRSI;
def op = c[1];
AddChart(high = h, low = l, open = op, close = c, type = ChartType.CANDLE, Color.cyan);

#Midrange
plot Mid = (MaxRng + MinRng)/2;
Mid.setdefaultColor(color.light_gray);
Mid.hidebubble();
Mid.hidetitle();
I have a question I’m hoping someone can clarify. If I wanted to use the typical TMO length of 14, keep the default RSI length of 2, and display both of these two plots on the typical TMO y-axis scale of -14 to +14, do I only need to change the following?

1. Change this value to 14:
input Tmo_data_length = 10;
2. Change these values to 14 and -14:
Code:
input MaxRng = 100;#Max range value
input MinRng = 0;#Min range value

Then having made these changes, the math for the RSI and TMO plots will still be correct in terms of their plots’ proportionalities, and so the normalization will still produce the same plot shapes as they would have from keeping the original MaxRng and MinRng settings (but simply with different y-axis values)? I just want to make sure I understand this point, thanks to anyone who can confirm 🙏🏻
 
@imk99

Not sure I follow, but try it and see if it scales correctly. If not fool with the parameters.

Regards,
Bob
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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