TMO with Higher Agg_Mobius @ TSL

Everyone is free to trade how they want to...,HOWEVER, Mobius suggest using 5-10 times the current timeframe...The suggestions in the header of the script. IMO 1-4 min is very close...IF you're going to trade such lower timeframes I'd suggest 1, 3, 5 min...There is a TMO MTF version that incorporates 3 timeframes...Use the search to find it. You can also try something like 15 min 5 min and 1 min...Hope this helps.

Hello-- made a slight modification and great point.. Is there a way to only include RTH session trades with no over night holds in the Strategy that @YungTraderFromMontana created? Thanks...
 
Hello everyone and thank you for all the sharing and the great work you all do here.

Just a quick question. Whenever I try to load any of the scan scripts posted here, I'm getting the following error message:

"Exactly one plot expected"

I know it's something I'm doing wrong because I've tried several scripts and I always get the same message. I can't figure out what it is and would appreciate any guidance. Thank you so much!
 
Here is an indicator that adds labels for the TMO indicator
add several of them to the same chart section to get the outlook from several higher timeframes

Code:
##################################################

declare lower;
input period = AggregationPeriod.DAY;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
DefineGlobalColor("Long", Color.Green);
DefineGlobalColor("Short", Color.RED);
DefineGlobalColor("Neutral", Color.Yellow);
DefineGlobalColor("arrow Buy", Color.Cyan);
DefineGlobalColor("arrow Sell", Color.Orange);

Script SymbolTMO{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
input length = 14;
input calcLength = 5;
input smoothLength = 3;
def data = fold i = 0 to length
           with s
           do s + (if cp > getValue(op, i)
                   then 1
                   else if cp < getValue(op, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
Def Main = ExpAverage(EMA5, smoothLength);
Def Signal = ExpAverage(Main, smoothLength);
Plot Result = If main > Signal then 1 else if Main <  Signal then -1 else 0;}
Script SymbolTMOArrow{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
input length = 14;
input calcLength = 5;
input smoothLength = 3;
def data = fold i = 0 to length
           with s
           do s + (if cp > getValue(op, i)
                   then 1
                   else if cp < getValue(op, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
Def Main = ExpAverage(EMA5, smoothLength);
Def Signal = ExpAverage(Main, smoothLength);
Plot Result = If main Crosses Above Signal then 1 else if Main Crosses Below Signal then -1 else 0;}
def currentPeriod = GetAggregationPeriod();
def s1;
def h1;

if period >= currentPeriod {
    s1 = SymbolTMO(period = period ,Length = Length, calclength = calcLength,SmoothLength = smoothLength);
    h1 = SymbolTMOArrow(period = period ,Length = Length, calclength = calcLength,SmoothLength = smoothLength);
} else {
    s1 = Double.NaN;
    h1 = DOuble.Nan;
}
AddLabel(!IsNaN(s1), "TMO:" + (if period == AggregationPeriod.MONTH then "M"
else
if period == AggregationPeriod.WEEK then "W"
else
if period == AggregationPeriod.FOUR_DAYS then "4D"
else
if period == AggregationPeriod.THREE_DAYS then "3D"
else
if period == AggregationPeriod.TWO_DAYS then "2D"
else
if period  == AggregationPeriod.DAY then "D"
else
if period == AggregationPeriod.FOUR_HOURS then "4H"
else
if period == AggregationPeriod.TWO_HOURS then "2H"
else
if period == AggregationPeriod.HOUR then "60m"
else
if period == AggregationPeriod.THIRTY_MIN then "30m"
else
if period == AggregationPeriod.TWENTY_MIN then "20m"
else
if period  == AggregationPeriod.FIFTEEN_MIN then "15m"
else
if period == AggregationPeriod.TEN_MIN then "10m"
else
if period == AggregationPeriod.FIVE_MIN then "5m"
else
if period == AggregationPeriod.FOUR_MIN then "4m"
else
if period  == AggregationPeriod.THREE_MIN then "3m"
else
if period == AggregationPeriod.TWO_MIN then "2m"
else
if period  == AggregationPeriod.MIN then "1m"
else ""), if s1 == 1 then GlobalColor("Long") else if s1 == -1 then GlobalColor("Short") else GlobalColor("Neutral"));
AddLabel(!IsNaN(h1) and h1 != 0, If h1 == 1 then "B" else if h1 == -1 then "S" else "-", if h1 == 1 then GlobalColor("arrow Buy") else if h1 == -1 then GlobalColor("arrow Sell") else color.gray);
 
@Thomas In post #8 of this discussion, I thought I was looking at two TMOs on your chart example, but one of them appears to be a histogram. I spent hours looking for something similar and finally gave it up. Did you customize one of your TMOs to display as a histogram, or is that a different oscillator?
 
@Thomas In post #8 of this discussion, I thought I was looking at two TMOs on your chart example, but one of them appears to be a histogram. I spent hours looking for something similar and finally gave it up. Did you customize one of your TMOs to display as a histogram, or is that a different oscillator?

Yes, I changed it, in your charts window>studies>indicator details you can change from histogram to line, and width

WaGTTpn.png
 
I've actually played with that option and didn't make the connection. I started watching the videos you recommended as well. That one post opened my eyes to several things at once, thank you very much!
 
I've actually played with that option and didn't make the connection. I started watching the videos you recommended as well. That one post opened my eyes to several things at once, thank you very much!
unfortunately I don't remember what I posted, but.....if there are things in this forum you can use, that are lightbulbs,......grab em....
 
Can someone please clarify how to best use this indicator for the purpose of swing trading long and short (not day trading) the S&P 500 with the ETF SPY? Is the idea to overlay the daily TMO with the weekly TMO and when the daily TMO crosses above the weekly TMO go long, and when the daily TMO crosses below the weekly TMO go short? Is there anything else I am missing or is this even the correct way to use it for my intended purpose? Thanks very much in advance!
 
I've actually played with that option and didn't make the connection. I started watching the videos you recommended as well. That one post opened my eyes to several things at once, thank you very much!
That's what the videos were intended for, if you only take the idea. Now take the idea that shocks move in 4% bursts.....
 
Can someone please clarify how to best use this indicator for the purpose of swing trading long and short (not day trading) the S&P 500 with the ETF SPY? Is the idea to overlay the daily TMO with the weekly TMO and when the daily TMO crosses above the weekly TMO go long, and when the daily TMO crosses below the weekly TMO go short? Is there anything else I am missing or is this even the correct way to use it for my intended purpose? Thanks very much in advance!
You understand the main idea. Did you read through the entire thread....there are some alternative ideas....
 
Can anyone help me create a study for Long and Short signals using TMO Daily and TMO weekly crossovers? I would like to keep the study as simple as possible. The study would plot in the upper chart pane and would only plot arrows above and below the candlesticks when the following conditions are met:

1. When TMO daily crosses below TMO weekly AND TMO daily matches the direction of TMO weekly - a red arrow pointing down appears above the candlestick (Short).

2. When TMO daily crosses above TMO weekly AND TMO daily matches the direction of TMO weekly - a green arrow pointing up appears below the candlestick (Long).

The Long and Short signals are based on skynetgen's description in this post:
https://usethinkscript.com/threads/tmo-or-rsi-in-laguerre-time-with-fe-q-a.477/post-3813

But instead of plotting the actual indicators TMO daily and TMO weekly crossing over in the lower chart pane like in skynetgen's picture, this study would only plot up arrows below the candlestick (Long) and down arrows above the candlestick (Short) when the crossovers occur and both aggregations are in directional unison per skynetgen's description.
 
Last edited:
@markos or anyone

this indicator I use it now on 15 min chart, and I see the agg set to 30 min, so when it prints on chart , does it lag? I mean it prints after a couple of candle close or it uses the previous candles closed to print the arrow?
 
@tem2005 The term "lag" would not be appropriate for this situation. The signal may appear on your chart and disappear while the candle on the 30m chart fo whichever higher agg period you set it to is still developing. Your best bet is to wait for the candle on the higher aggregation period to close for confirmation.
 
So I've revisited this and have found that it can be turned into a nice volume rate of change indicator with some small changes.
I created a switch for changing between the default data inputs (open/close) and volume.
Also added some small labels showing current/previous signals up to 6 bars.
Made it easier to change the color scheme, too.

Decided to point this out because I thought you all would find it useful/interesting...

in this screen the orange/blue is the one set to volume, other is default.
Cloyx31.png


Code:
# 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.
#Welkin: added a switch to toggle between the default data inputs open/close to volume, turning this into a volume ROC indicator. Added some labels showing signals for up to 6 bars. Also made it easier to change the color scheme.

declare Lower;
input dataInput = {default open_close, volume};
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.FIVE_MIN;
input showLabels = yes;

def o;
def c;
switch(dataInput){
case open_close:
o = open(period = agg);
c = close(period = agg);
case volume:
o = volume(period = agg);
c = volume(period = agg);
}
DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Bearish", Color.RED);
DefineGlobalColor("OverBought", CreateColor(100,40,40));
DefineGlobalColor("OverSold", CreateColor(40,40,100));

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);
def sigtest = Main > Signal;
     Main.AssignValueColor(if sigtest
                           then GlobalColor("Bullish")
                           else GlobalColor("Bearish"));
     Signal.AssignValueColor(if sigtest
                             then GlobalColor("Bullish")
                             else GlobalColor("Bearish"));
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, GlobalColor("Bullish"), GlobalColor("Bearish"));
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();
#Labels
AddLabel(showLabels,"    ", Color.BLACK);
AddLabel(showLabels," ", if sigtest[5] then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(showLabels," ", if sigtest[4] then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(showLabels," ", if sigtest[3] then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(showLabels," ", if sigtest[2] then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(showLabels," ", if sigtest[1] then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(showLabels," ", if sigtest then GlobalColor("Bullish") else GlobalColor("Bearish"));

addCloud(ob, length, GlobalColor("OverBought"), GlobalColor("OverBought"));
addCloud(-length, os, GlobalColor("OverSold"), GlobalColor("OverSold"));
# End Code TMO with Higher Aggregation
 
I have a contribution to the group and a favor

My contribution - Below is code I modified to show the TMO arrows using the current time period and an alternate time period.

Favor - I was hoping someone could help me take the study I am sharing and plot a 1 when both TMO timeframes are in sync to the upside and plot a -1 when both TMO timeframes are in sync to the downside. The code below is not working for me and I am not sure why.

++++++++++++++++++++++++++++++++

Here is the code that shows the TMO arrows using the current time period and an alternate time period. BTW, I am using input length 21 as it seems to produce less whipsaw than the 14.

Code:
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation breakouts only
# Mobius
# custom by WTF_Dude based off 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.

declare upper;

input length = 21;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.DAY;


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);
def Main = ExpAverage(EMA5, smoothLength);
def 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 Bull = Crosses(main, signal, CrossingDirection.ABOVE);
plot Bear = Crosses(main, signal, CrossingDirection.BELOW);
Bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Bull.SetDefaultColor(Color.CYAN);
Bull.SetLineWeight(5);
Bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Bear.SetDefaultColor(Color.RED);
Bear.SetLineWeight(5);

def o1 = open;
def c1 = close;
def data1 = fold i1 = 01 to length
           with s1
           do s1 + (if c1 > getValue(o1, i1)
                   then 1
                   else if c1 < getValue(o1, i1)
                        then - 1
                        else 0);
def EMA51 = ExpAverage(data1, calcLength);
def Main1 = ExpAverage(EMA51, smoothLength);
def Signal1 = ExpAverage(Main1, smoothLength);
     #Main.AssignValueColor(if Main1 > Signal1
       #                    then color.green
         #                 else color.red);
    # Signal.AssignValueColor(if Main1 > Signal1
     #                        then color.green
      #                       else color.red);
    # Signal.HideBubble();
     #Signal.HideTitle();
#addCloud(Main1, Signa1l, color.green, color.red);



plot Bull1 = Crosses(main1, signal1, CrossingDirection.ABOVE);
plot Bear1 = Crosses(main1, signal1, CrossingDirection.BELOW);
Bull1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Bull1.SetDefaultColor(Color.YELLOW);
Bull1.SetLineWeight(3);
Bear1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Bear1.SetDefaultColor(Color.MAGENTA);
Bear1.SetLineWeight(3);

+++++++++++++++++++++++++++++++++++++++

Here is the code that needs some TLC. I basically took the code from above and tried to plat a 1 when both TMO timeframes are up and a -1 when both TMO timeframes are down. It is currently not working and would appreciate some help. My goal is the use this to create a scan and then set-up text alerts. Thank you.

Code:
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation breakouts only
# Mobius
# custom by WTF_Dude based off 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.

declare lower;

input length = 21;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.DAY;


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);
def Main = ExpAverage(EMA5, smoothLength);
def 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);

Def LongU = Crosses(main, signal, CrossingDirection.ABOVE);
Def ShortD = Crosses(main, signal, CrossingDirection.BELOW);

def Bull = if LongU then 1 else if main<signal then 0 else bull[1];
def Bear = if ShortD then 1 else if main>signal then 0 else bear[1];

def o1 = open;
def c1 = close;
def data1 = fold i1 = 01 to length
           with s1
           do s1 + (if c1 > getValue(o1, i1)
                   then 1
                   else if c1 < getValue(o1, i1)
                        then - 1
                        else 0);
def EMA51 = ExpAverage(data1, calcLength);
def Main1 = ExpAverage(EMA51, smoothLength);
def Signal1 = ExpAverage(Main1, smoothLength);
     #Main.AssignValueColor(if Main1 > Signal1
       #                    then color.green
         #                 else color.red);
    # Signal.AssignValueColor(if Main1 > Signal1
     #                        then color.green
      #                       else color.red);
    # Signal.HideBubble();
     #Signal.HideTitle();
#addCloud(Main1, Signa1l, color.green, color.red);

Def LongU1 = Crosses(main, signal, CrossingDirection.ABOVE);
Def ShortD1 = Crosses(main, signal, CrossingDirection.BELOW);

def Bull1 = if LongU1 then 1 else if main1<signal1 then 0 else bull1[1];
def Bear1 = if ShortD1 then 1 else if main1>signal1 then 0 else bear1[1];


def LongUp = if bull and bull1 then 1 else if (main<signal or main1<signal1) then 0 else longup[1] ;
def ShortDown = if bear and bear1 then 1 else if (signal>main or signal1>main1) then 0 else shortdown[1];

plot alert1 = if longup==1 then 1 else if shortdown==1 then -1 else 0;
plot zeroline = 0;
 
Last edited by a moderator:
@trouble56 Can you explain your reasoning behind adding a 1 and -1 into the condition? What is it that you're trying to achieve?
 
@BenTen I didn't realize it would work with this study as It isn't a straight TMO indicator, it weeds out some of the signals. if it can that would be great.
However, if I know how to create the study I was referring to, it would also enable me to create a strategy so I can backtest it to see how it works and how it works using different timeframes
 

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

Thread starter Similar threads Forum Replies Date
tenacity11 Archived: TMO True Momentum Oscillator Indicators 346
BenTen TMO True Momentum Oscillator For ThinkOrSwim Indicators 128

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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