TMO with Higher Agg_Mobius @ TSL

lrc11239

lrc11239

Member
VIP
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...
 
T

TraderGary

New member
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!
 
J

JWH

New member
VIP
@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?
 
T

Thomas

Active member
@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

 
J

JWH

New member
VIP
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!
 
T

Thomas

Active member
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....
 
D

David45

Member
2019 Donor
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!
 
T

Thomas

Active member
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.....
 
T

Thomas

Active member
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....
 
D

David45

Member
2019 Donor
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:
T

tem2005

Member
VIP
@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?
 
BenTen

BenTen

Administrative
Staff
VIP
@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.
 
Welkin

Welkin

Active member
VIP
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.


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
 
T

trouble56

New member
VIP
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:
BenTen

BenTen

Administrative
Staff
VIP
@trouble56 Can you explain your reasoning behind adding a 1 and -1 into the condition? What is it that you're trying to achieve?
 
T

trouble56

New member
VIP
@BenTen the 1 and the -1 will allow me to set-up a scan as I want to be alerted when both time frame TMO are trending up or are trending down
 
T

trouble56

New member
VIP
@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
 
BenTen

BenTen

Administrative
Staff
VIP
@trouble56 You can refer to this code that @Maya posted here. It combines two different agg for TMO. You may have to adjust the condition (crossing above/below) that you wanted.
 

Similar threads

Top