Archived: TMO True Momentum Oscillator

Status
Not open for further replies.
@JE $$
You could make a watchlist
IEf8RM8.png

http://tos.mx/Gbrjdjt
Hello MerryDay, What is $tmo in presented screen, can you pls point me to post which allows to get these numbers if they are TMO lower study numbers from post #1
 
@MerryDay ,....you are terrific,...love the colors in the columns,......there happened to be a couple minor errors, here's my corrected code.

Code:
# TMO ((T)rue (M)omentum (O)scilator) Scan
# Mobius, with modifications by tomsk, 1.1.2020
# V01.05.2018
#hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, trend reversals and divergence than momentum oscillators using price.

input length = 14;
input calcLength = 5;
input smoothLength = 5;#3
input level = -5;   ##Bullish Scan
#input level = 10;   ##Bearish Scan

def o = open;
def c = close;
def data = fold i = 0 to length
           with s
           do s + (if c > getValue(o, i)
                   then 1
                   else if c < getValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);
addchartBubble(close,close,main);
#plot sell = main crosses below 10 ;
#hint: Comment out using # below to scan for Bullish or Bearish.  Please note that ## applies to conditional scan with parameters -10 (over sold condition) Bullish Scan) and 10 (over bought condition) Bearish Scan) Default is set to a Bullish TMO Scan without any conditions.

##[B][I]Bullish Scan[/I][/B]
#plot scan = main crosses above level;
plot scan = main < level and signal < level and main > signal;
#plot scan = main < main[1] and signal < signal[1];

##[B][I]Bearish Scan[/I][/B]

#plot scan = main > level and signal > level and main < signal;
#plot scan = main > main[1] and signal > signal[1];
 
Last edited by a moderator:
Merry, this TMO is the first indicator I found, ever, that worked, meaning, tradeable information. How did you come about the input levels, I saw on another BTD/TMO level smaller input numbers, based on a daily chart,.... has someone posted optimal levels to adjust results. If TMO truly reacts from Delta/Options, then I will discard everything for only this to help assist in trading decisions, because this works.
 
@Thomas The TMO is a great indicator but at the moment, I am not using it to determine entry. Currently, I only use it to verify positive trends/momentum on higher agg charts (2hr or higher).
 
Hello, I have been testing, using and trading with TMO. It is among one of my top indicators (I don't have many though).

As I am charting a lot with Tradingview, it's convenient to keep an eye on TMO directly on the same platform, I wonder if someone would be nice to convert TMO into Tradingview script.

Thank you

EDIT: I think I found what I need here. Sharing for other users.
https://www.tradingview.com/script/o9BQyaA4-True-Momentum-Oscillator/
 
Last edited:
scanning through here looking for tmo script that adds arrows to chart for the main and signal crosses..anyone have it? yes I'm looking and will continue to look and yes I have tried to write it myself. thanks
 
@Iceburgh Sure thing. Here you go:

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.
# Modified by BenTen 03/24/2021: added arrows to upper chart

input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
           with s
           do s + (if c > getValue(o, i)
                   then 1
                   else if c < getValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);
plot up = if Main crosses above Signal then low else double.nan;
plot down = if Main crosses below Signal then high else double.nan;
up.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
down.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
 
Added breakout signals

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.

declare Lower;

input length = 14;
input calcLength = 5;
input smoothLength = 3;

#input symbol = "SPX";
def o = open;#(symbol);
def c = close;#(symbol);
def data = fold i = 0 to length
           with s
           do s + (if c > getValue(o, i)
                   then 1
                   else if c < getValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
     Main.AssignValueColor(if Main > Signal
                           then color.green
                           else color.red);
     Signal.AssignValueColor(if Main > Signal
                             then color.green
                             else color.red);
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
plot zero = if isNaN(c) then double.nan else 0;
     zero.SetDefaultColor(Color.gray);
     zero.hideBubble();
     zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .7);
     ob.SetDefaultColor(Color.gray);
     ob.HideBubble();
     ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .7);
     os.SetDefaultColor(Color.gray);
     os.HideBubble();
     os.HideTitle();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);

input showBreakoutSignals = no;


plot longsignal = if main crosses above signal then main else Double.NaN;
plot shortSignal = if main crosses below signal then signal else Double.NaN;

longSignal.SetHiding(!showBreakoutSignals);
shortSignal.SetHiding(!showBreakoutSignals);

longsignal.SetDefaultColor(Color.UPTICK);
longsignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
shortSignal.SetDefaultColor(Color.DOWNTICK);
shortSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
# End Code TMO
 
@Sagar Theoretically, the labels should work. Did you try to add them to the MTF TMO Indicator?
If not, give it a go. If you run into syntax errors, I will be glad to help you troubleshoot them.

I, myself, have no interest in putting the effort into such a project because I don't believe the information in the labels would necessarily be accurate. MTF indicators on a chart are great when used overall to analyze historical purposes, however, they are problematic when reading the current candle as explained in this link.
 
Last edited:
@JE $$
You could make a watchlist
IEf8RM8.png

Ruby:
# ########################################################
# TMO ((T)rue (M)omentum (O)scilator) WatchList Column Only
# Mobius, with modifications by tomsk, 1.1.2020
#with WatchList added by @MerryDay 12/2020
#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.
input showlabels = yes ;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input tmo_ob =  10;
input tmo_os = -10;

def data = fold i = 0 to length
           with s
           do s + (if close > getValue(open, i)
                   then 1
                   else if close < getValue(open, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);
# ########################################################
#charting and formatting
plot TMO = round(main,0);
#DefineGlobalColor("pretrend", CreateColor(50, 200, 255)) ;
#DefineGlobalColor("TrendBEGIN", CreateColor(0, 0, 255)) ;
#DefineGlobalColor("rising",  CreateColor(0, 165, 0)) ;
#DefineGlobalColor("maxxed", CreateColor(255, 139 ,61)) ;
#DefineGlobalColor("TrendEnd", CreateColor(255, 204, 0)) ;
#DefineGlobalColor("falling",  CreateColor(225, 0, 0)) ;
#DefineGlobalColor("neutral", CreateColor(204, 204, 204)) ;
AssignBackgroundColor(
if main < tmo_os      then CreateColor(50, 200, 255) else
if main > tmo_ob      then CreateColor(255, 139 ,61) else
if main crosses above tmo_os then CreateColor(0, 0, 255) else
if main crosses below tmo_ob then CreateColor(255, 204, 0) else
if main < signal  then CreateColor(225, 0, 0) else
if main > main[1] then CreateColor(0, 165, 0) else CreateColor(204, 204, 204)) ;
Shared Link: http://tos.mx/6HaRN1a
Hi @MerryDay I have a quick question. When I add the WL column do I select 5 min or a day? Thanks in advance
 
s1111 If you are using the TMO indicator to trigger or confirm signal then set the timeframe as the same as the chart you are trading on.
If you are using it to confirm trend, then set it to 3 or 4 times higher aggregation than the chart you trade on.

The TMO is compatible with all timeframes. Feel free to set up more than one column testing different time frames and see what works best for you. HTH
 
Needed TMO normalized code to run with RSI scale to run scan with if needed. Normalizing code can be very useful for scans and utilizing the same lower study to pile on a few indicators.

Image below, code below image.
QTcN4v9.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.
#4/13/21 @rlohmeyer modified raw code and normalized for RSI scale

declare Lower;

input data_length = 14;
input EMA_Length = 5;

def o = open;
def c = close;
def data = fold i = 0 to data_length with s do s + (if c > getValue(o, i) then 1 else if c < getValue(o, i)    then - 1 else 0);
def Main = ExpAverage(data, EMA_Length);
#Scale Normalization Code
def hh = Round(highestAll(main),2);
def ll = Round(lowestall(main),2);
plot TMO = ((main-ll)/(hh-ll))*100;
TMO.setdefaultColor (color.yellow);
 
Sorry I should have specified, I was referring to the original code that started this thread. Does anyone know how to paint the candle sticks the same color as the oscillator? (If oscillator is showing green, the candle sticks would be painted the same color?)
Ruby:
# 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.

declare Lower;

input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
with s
do s + (if c > getValue(o, i)
then 1
else if c < getValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
plot zero = if isNaN(c) then double.nan else 0;
zero.SetDefaultColor(Color.gray);
zero.hideBubble();
zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .7);
ob.SetDefaultColor(Color.gray);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .7);
os.SetDefaultColor(Color.gray);
os.HideBubble();
os.HideTitle();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);
# End Code TMO


@rlohmeyer Thanks anyway though!
 
Last edited by a moderator:
For those interested I include how I am using TMO combined with 2 RSI indicators on a normalized scale for swing trading on day charts. Below is a graphic and below that the code. TMO in yellow. The RSI's in Cyan and Magenta.
lxPOJt9.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.
#@rlohmeyer: RSI,TMO on normalized scale
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
input Tmo_Price = close;
input Tmo_data_length = 5;
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 = ExpAverage(TMOdata, TMO_EMA_Length);
#RSI
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);
#RSI2
input RsiTwoPrice = close;
def RsiTwoAverage = AverageType.WILDERS;
input RsiTwoAvgLength = 2;
def NetChgAvg2 = MovingAverage(RsiTwoAverage, RsiTwoPrice - RsiTwoPrice[1], RsiTwoAvgLength);
def TotChgAvg2 = MovingAverage(RsiTwoAverage, AbsValue(RsiTwoPrice - RsiTwoPrice[1]), RsiTwoAvgLength);
def ChgRatio2 = if TotChgAvg2 != 0 then NetChgAvg2 / TotChgAvg2 else 0;
def RS2 = 50 * (ChgRatio2 + 1);
input RsiTwoEmaLength = 2;
def RSIavg2 =  ExpAverage(RS2, RsiTwoEmaLength);

#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 );
def newRSI2 = normalizePlot(RSIavg2, MinRng, MaxRng );
#Plots
plot TMO = newTMO;
TMO.setdefaultColor(color.yellow);
TMO.Hidebubble();
TMO.hidetitle();

plot RSI = newRSI;
RSI.setdefaultColor(color.cyan);
RSI.hidebubble();
RSI.hidetitle();

plot RSI2 = newRSI2;
RSI2.setdefaultColor(color.magenta);
RSI2.hidebubble();
RSI2.hidetitle();

plot Mid = (MaxRng + MinRng)/2;
Mid.setdefaultColor(color.light_gray);
Mid.hidebubble();
Mid.hidetitle();
 
Status
Not open for further replies.

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
297 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