# True Momentum Oscillator for ThinkorSwim

#### BenTen

Staff
VIP
The following thinkScript of the true momentum oscillator was created by Mobius.

It calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.

### thinkScript Code

Rich (BB 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;

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();
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();
# End Code TMO``````

https://tos.mx/yXqNwi

Last edited:

#### markos

##### Well-known member
VIP
This one runs under my RSI Laguerre on a daily chart. Mobius recently put it on his trading chart. Turn off after and before market hours. Delta of price is really only calculated during RTH. Unless you're trading futures, then if there's option trading, there's Delta of Price, as I understand it.
*It is traded at the polarity change signal, not the zero line. I love this indicator.

#07:10 Mobius: Had the opportunity to do some reading over the weekend and found an interesting paper on an old subject, Momentum. The author suggested the purest way to measure momentum was by using delta of price rather than variance in price in order to eliminate the inherent volatility in price. This indicator does that.

Mobius TMO WatchList Column Code. Plots 1 and green if main is above signal and 0 and red otherwise.

Code:
``````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 isTrue = if Main > Signal then 1 else 0;
AssignBackgroundColor(if Main > Signal
then color.green
else color.red);``````

Last edited:

#### tenacity11

##### Active member
2019 Donor
@markos This looks like a good fit with the RSI Laguerre. Definitely worth testing. Thanks for the heads up on the combo.

#### markos

##### Well-known member
VIP
@markos
This looks like a good fit with the RSI Laguerre. Definitely worth testing. Thanks for the heads up on the combo.
@tenacity11 you're welcome. My mods to the indicator are swapping the red/green ob/os lines. I like green on top because if the stock is moving up, it will be in the green. Because I use this on daily and weekly charts, for me, I use 21,5,3. I don't recommend anyone changing that on less than daily, imo. Markos

#### tenacity11

##### Active member
2019 Donor
@markos When using the trend Momentum and the RSI Laguerre do you use regular candles or heiken ashi? I'm wondering since heiken ashi is lagging if it would make a difference or if the parameters would need to be changed.
thanks

#### markos

##### Well-known member
VIP
@tenacity11 If I am able, I'll reshare my main chart later tonight. Hieken Ashi with SlimRibbons with lots of color.... bad eyes. Heiken ashi don't actually lag but people can debate that; Whether I use Bars, Candles or HACandles, the indicators math/parameters are kept the same. (EDITED by me >>) Oops, I may have spoke to soon, need to check later but I think RSILg I never change but the TMO should match the chart's time frame...... more later.

Last edited:

#### tenacity11

##### Active member
2019 Donor
@markos. thanks. I really like heiken ashi smoothness but getting used to what I think is lag of price will take some getting used to.

#### markos

##### Well-known member
VIP
I edited the post above but I need to check the code to see if MY TMO is set to time periods or actual days.
@tenacity11 switch your chart between an HAshi and a bar chart and look closely at the little amount of difference there is and then see if that is important for you at the time frames you choose.

You must be able to believe in your system in order to pull the trigger to get in and out without 2nd guessing.

Last edited:

#### markos

##### Well-known member
VIP
@tenacity11
I am going to share my daily chart and my short term chart, therefore, the individual codes for the studies will not be posted but in the chart itself.
• Please note that the daily chart has candles and the 30 day 1 hour chart is a Heiken Ashi.
• About time frames: the TMO on the 30 day chart changes with the chart and there is no need to adjust anything. The same goes for the RSI Laguerre on any chart.
• Please note that the daily chart has both a daily and weekly TMO and if you use that particular study, you will need to change the Agg to match your chart.
• The colors of the candles and volume bars are controlled by the Slim Ribbon study. Those colors are in the color bar tab of the settings.
• Also, if you minimize the plots, you will see alarm settings. Turn on or shut them off here so that you do not have to comment anything out.

Last edited:

VIP

### TMO w Higher Agg as Shown in Daily Chart

08:43 Mobius: Well, give it a few days to get altered, munched, distorted and twisted. Then when it gets back to being used as intended someone will start making money with it.
08:45 Mobius: Oh and in my view - It's highest and best use is as designed with a secondary aggregation plotted either on it or with it around 5 to 10 times higher.
https://tos.mx/bc1Hwy
Code:
``````#TMO True Momentum Oscillator with Higher Aggregation _Mobius
#Tuesday, May 15, 2018 12:36 PM
## OneNote Archive Name: TMO True Momentum Oscillator with Higher Aggregation _Mobius
## Archive Section: Momentum
## Suggested Tos Name: TrueMomentumOscillator_w_HigherAggregation_Mobius
## Archive Date: 5.15.2018
## Archive Notes:
## 08:43 Mobius: Well give it a few days to get altered, munched, distorted and twisted. Then when it get back to being used as intended someone will start making money with it.
## 08:45 Mobius: Oh and in my view - It's highest and best use is as designed with a secondary aggregation plotted either on it or with it around 5 to 10 time higher.
## Original Code Follows
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation
# 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 agg = AggregationPeriod.weeK;

def o = open(period = agg);
def c = close(period = agg);
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();
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 * .8);
ob.SetDefaultColor(Color.gray);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .8);
os.SetDefaultColor(Color.gray);
os.HideBubble();
os.HideTitle();
addCloud(-length, os, Color.LIGHT_RED, Color.LIGHT_RED, showBorder = Yes);
# End Code TMO with Higher Aggregation``````

Last edited:

#### tenacity11

##### Active member
2019 Donor
@markos This was tremendously helpful being visual. I initially changed the W to 21,5,3 as you had originally suggested so I put the W with the 14,5,3 code underneath and it appears the 21,5,3 is smoother. Any particular reason you use candles on the daily and heiken ashi on the smaller time frames?I definitely see the worth of the gamma FE with the TMO

#### tenacity11

##### Active member
2019 Donor
I have to make an adjustment to the observation on the 21,5,3. I had it on regular candles(W) but when I put it on heiken ashi the 14,5,3 was a better fit.

#### MBF

##### Active member
2019 Donor
Marcos, I have a question. When I open this it opens in a separate window in TOS. When I close out, how do I reopen it into my main screen in TOS? I've seen this type of sharing a lot but never knew where to find it to switch over. Thanks!

#### markos

##### Well-known member
VIP
@MBF welcome back! In my mind, this is the best way to share.
When it is open, click Style, Save Style, Give it a name you will remember e.g. 1Y1D719, Check the box to Include Patterns and Study sets, and save it. To open it, click Style, Load Style, and load the file with the name you just saved.
Doing that will save all of the studies that are on the chart in the same form as presented. Hope that helps, Markos

#### MBF

##### Active member
2019 Donor
Thank you so much Marcos! Finally understand. Much wine for you!

#### markos

##### Well-known member
VIP
@markos This was tremendously helpful being visual. I initially changed the W to 21,5,3 as you had originally suggested so I put the W with the 14,5,3 code underneath and it appears the 21,5,3 is smoother. Any particular reason you use candles on the daily and heiken ashi on the smaller time frames?I definitely see the worth of the gamma FE with the TMO
Hi @tenacity11 Concerning your question about the candles and the HA on the one year VS 30 day: there is no particular reason, I posted that way so that the difference could be seen.

I rarely use Candles, having been trained on Bar charts. My one year chart I use bars on and the 30 day I use HA, just because… I'm different.

With the TMO, when using the original as shown on the 30 day chart, there is no Agg to change, my suggestion is 14, 5, 3 because that's the way Mobius created it. My understanding is that's what he uses all the way down to five minute charts.

Here is a video from the slim ribbon creator: https://askslim.com/slim-ribbon/

Last edited:

#### markos

##### Well-known member
VIP

A number of questions: have you had a platform tour? Have you been to MyTrade on ToS? If you have not had your tour, please schedule one by clicking the support button at the top. Have 10 questions specific to what you want to know.

#### tenacity11

##### Active member
2019 Donor

A number of questions: have you had a platform tour? Have you been to MyTrade on ToS? If you have not had your tour, please schedule one by clicking the support button at the top. Have 10 questions specific to what you want to know.
I have had a platform tour and have seen My Trade but have never used it.

#### markos

##### Well-known member
VIP
I have had a platform tour and have seen My Trade but have never used it.