True Momentum Oscillator for ThinkorSwim

markos

markos

Well-known member
VIP
Can somebody post the link to the "True_Momentum" thread

I'm looking a description

@rob_will_trade_it This is one of many, type TMO Oscillator in the search box.
 
Last edited:
markos

markos

Well-known member
VIP
what is everyone using in conjunction with this indicator? I am looking for more confirmation,
@dmillz If you need more confirmation, consider that you may be using too many indicators already.
Multi-collinearity is dangerous to your trading account.

Do you also have the MTF TMO on your chart at 5x larger than your main chart?
In the end you'll have to find one that works for you and following someone else may not help you find it.

Please re-read all of the TMO material in the Reference thread. Use the search bar above. Best of luck.
 
D

dmillz

Member
@dmillz If you need more confirmation, consider that you may be using too many indicators already.
Multi-collinearity is dangerous to your trading account.

Do you also have the MTF TMO on your chart at 5x larger than your main chart?
In the end you'll have to find one that works for you and following someone else may not help you find it.

Please re-read all of the TMO material in the Reference thread. Use the search bar above. Best of luck.

Hey Thanks, Im using it on a 5 minute chart for day trading, Its a bit harder to manage than longer 1 hour charts etc. I found the SVE StochRSI and reversal trend indicator works pretty well. I guess i was just looking for the RSI so i could time my exits correctly because its hard to determine the top with the TMO indicator.
 
markos

markos

Well-known member
VIP
Hey Thanks, Im using it on a 5 minute chart for day trading, Its a bit harder to manage than longer 1 hour charts etc. I found the SVE StochRSI and reversal trend indicator works pretty well. I guess i was just looking for the RSI so i could time my exits correctly because its hard to determine the top with the TMO indicator.
In that case, look into RSI Laguerre in search & Tutorials. They "may" work better for exit timing... much more decisive.
 
N

Nick

Active member
2019 Donor
VIP
Hi @BenTen, is there a way to add a label, (Out) on the chart,, when the TMO colour changes from light Green to Red? thanks
 
BenTen

BenTen

Administrative
Staff
VIP
@binhvesting Both are two different types of indicators. I don't think you should compare them unless you find one to work significantly better than the other.
 
D

dmillz

Member
How do you extend the time on the bullish -10 scan... I keep missing things because they pop up for like 10 min then go away on the 1 hour chart
 
Last edited:
Branch

Branch

Member
VIP
Short and Buy Bubble Signals for momentum

Code:
declare lower;

input length = 7;
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.GREEN);
Signal.AssignValueColor(if Main > Signal then Color.RED else Color.RED);
Signal.HideBubble();
Signal.HideTitle();
AddCloud(Main, Signal, Color.GREEN, Color.BLACK);
plot zero = if IsNaN(c) then Double.NaN else 0;
zero.SetDefaultColor(Color.WHITE);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNaN(c) then Double.NaN else Round(length * .7);
ob.SetDefaultColor(Color.BLUE);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNaN(c) then Double.NaN else -Round(length * .7);
os.SetDefaultColor(Color.BLUE);
os.HideBubble();
os.HideTitle();

#BUBBLE
def CrossBar = if Main crosses Signal then BarNumber() else Double.NaN;


#CLOUD__________________________________________________________________________________________________________________
AddCloud(ob, length, Color.gray, Color.gray, no);
AddCloud(-length, os, Color.gray, Color.gray);

#DOTSandBUBBLES______________________________________________________________________________________________________________________
plot DownSignal = if Main crosses below Signal then Signal else Double.NaN;
DownSignal.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
AddChartBubble((DownSignal) and (DownSignal), DownSignal, "S" , Color.RED);

plot UpSignal = if Main crosses above Signal then Signal else Double.NaN;
UpSignal.SetPaintingStrategy(PaintingStrategy.Arrow_Up);
AddChartBubble((UpSignal) and (UpSignal), UpSignal, "B" , Color.GREEN);

AddLabel (yes, if Main > Signal then "(2) MOMENTUM: BUY" + "" else "", Color.GREEN);
AddLabel (yes, if Main < Signal then "(2) MOMENTUM: SELL" + "" else "", Color.RED);
 
Last edited:
T

TraderKevin

Member
I've started watching the TMO and think it's a pretty solid indicator, but would like to backtest some ideas with it using more accurate engines such as on Quantconnect. To do that, I need to convert the code to Python, but I don't really understand what the variable "data" is doing in the code (see below code snippet). Does anyone understand this, and what exactly it is calculating? I know it's the delta of price, but I obviously need to be able to mimic it's behavior exactly in Python and therefore need a more specific answer. Any help is GREATLY appreciated, and I'd be happy to share the results I come to when complete.

Code:
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);
 
rad14733

rad14733

Well-known member
VIP
@TraderKevin What you are experiencing is the result of coders not using English Language variable names which is what makes scripting languages so desirable... Old coding habits from other languages die hard but I wish at least the members here would start expanding their variable names... The benefit of doing so with scripting languages is that the code then becomes self-documenting and requires little to no comments...

All that being said, what the fold loop is doing is to calculate a value based on the closing price of the 7 previous candles/bars and providing an exponential average of those values...
 
J

JE $$

New member
Hi. I'm trying to build a scanner that captures stocks with
vol >500K, market cap >50M, price above 10 (all easy)
AND
currently in a TTM squeeze (for at least 2 days) (easy)
AND
(and this is the HARD part)
who, using the TMO, are below zero and where I can catch the first day where the TMO ribbon changes from red to green. I have built the following so far but i have to scroll through everything to try and find that red to green change still.
Any ideas on how to accomplish this?
thanks

https://tos.mx/fy2Gwcx
 
H

hCaostrader

New member
I've been spending a lot of time with this indicator and have implemented it for other platforms. While doing that I've noticed a few problems or shortcomings that could easily be alleviated and I want to propose them here, to make a more universal and streamlined version that is better suited for implementation in TA libraries.

Here is a snippet of the affected original code:
Code:
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);

The first issue is that the indicator uses two sources. It looks at the open and the close. This is very uncommon and in most cases doesn't even make a difference. If there are no gaps between the candles, the close of i+1 is exactly the same as the open of i. On almost all graphs with smaller timeframes, the values will even be exactly identical. Having only one input source makes the indicator a lot more flexible though, because it can be applied to a variety of sources.
For this reason, I propose the following code change:
Code:
def data = fold i = 0 to length
           with s
           do s + (if c > GetValue(c, i+1)
                   then 1
                   else if c < GetValue(c, i+1)
                        then - 1
                        else 0);

The second issue is that the indicator looks at length+1 candles. A TMO 14 for example looks at 15 candles. I sincerely believe that this was not intended by the original author and is a bug in the math. I therefore propose that the code is instead changed to
Code:
def data = fold i = 1 to length
           with s
           do s + (if c > GetValue(c, i)
                   then 1
                   else if c < GetValue(c, i)
                        then - 1
                        else 0);
With this change, a TMO 14 would look at 14 candles and be bound between -14 and 14. It would also look back at the closing prices of length candles, like any other indicator (moving averages, RSI, MACD).

Last but not least, I propose to normalize the result to a range between -100 and 100. It makes it straightforward to work with different values for length, because on an oscillator this has no effect on the result.
Code:
s = s * 100 / length;

These changes wouldn't affect the essence of TMO. The new TMO 15 would be the same as the old TMO 14, if there are no gaps. With gaps, the results would only differ ever so slightly. The normalization would bring the entry signals at a fixed e.g. +70 and -70, similar to RSI, regardless of length.

What are your thoughts? Should TMO be changed with these "fixes"? Or should the fixes go into a spin-off version that's called something like "TMO - Universal Edition"?
 
Last edited:
tenacity11

tenacity11

Active member
2019 Donor
I've been spending a lot of time with this indicator and have implemented it for other platforms. While doing that I've noticed a few problems or shortcomings that could easily be alleviated and I want to propose them here, to make a more universal and streamlined version that is better suited for implementation in TA libraries.

Here is a snippet of the affected original code:
Code:
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);

The first issue is that the indicator uses two sources. It looks at the open and the close. This is very uncommon and in most cases doesn't even make a difference. If there are no gaps between the candles, the close of i+1 is exactly the same as the open of i. On almost all graphs with smaller timeframes, the values will even be exactly identical. Having only one input source makes the indicator a lot more flexible though, because it can be applied to a variety of sources.
For this reason, I propose the following code change:
Code:
def data = fold i = 0 to length
           with s
           do s + (if c > GetValue(c, i+1)
                   then 1
                   else if c < GetValue(c, i+1)
                        then - 1
                        else 0);

The second issue is that the indicator looks at length+1 candles. A TMO 14 for example looks at 15 candles. I sincerely believe that this was not intended by the original author and is a bug in the math. I therefore propose that the code is instead changed to
Code:
def data = fold i = 1 to length
           with s
           do s + (if c > GetValue(c, i)
                   then 1
                   else if c < GetValue(c, i)
                        then - 1
                        else 0);
With this change, a TMO 14 would look at 14 candles and be bound between -14 and 14. It would also look back at the closing prices of length candles, like any other indicator (moving averages, RSI, MACD).

Last but not least, I propose to normalize the result to a range between -100 and 100. It makes it straightforward to work with different values for length, because on an oscillator this has no effect on the result.
Code:
s = s * 100 / length

These changes wouldn't affect the essence of TMO. The new TMO 15 would be the same as the old TMO 14, if there are no gaps. With gaps, the results would only differ ever so slightly. The normalization would bring the entry signals at a fixed e.g. +70 and -70, similar to RSI, regardless of length.

What are your thoughts? Should TMO be changed with these "fixes"? Or should the fixes go into a spin-off version that's called something like "TMO - Universal Edition"?
I use the TMO and would be curious as to what your new code would look like and I would be happy to put it up against the current version on my 3m chart.
 
H

hCaostrader

New member
I use the TMO and would be curious as to what your new code would look like and I would be happy to put it up against the current version on my 3m chart.

If you just change the code snippet for data to
Code:
def data = fold i = 1 to length
           with s
           do s + (if c > GetValue(c, i)
                   then 1
                   else if c < GetValue(c, i)
                        then - 1
                        else 0);
then the old TMO 14 would be the same as the new TMO 15. At least as long as there are no gaps. On the 3m there most likely aren't any, since trading doesn't stop.

The normalization step is just additionally to have the same range across any chosen length. Adding the line
Code:
s = s * 100 / length;
just behind the data definition should be all that's needed. Unfortunately I cannot test the code, since I don't have ToS. But it would be great if you could tell me, whether the code runs without an error.

Like I said, I've been implementing TMO for other platforms and after noticing these problems thought that I should bring it up in the original thread, before I go and just make changes on my own.
 

Similar threads

Top