TMO with Higher Agg_Mobius @ TSL

H

HighBredCloud

Active member
VIP
@BenTen I found this in my archives for TMO scan...but I think the top portion is not necessary...Plus I edited the LONG portion below...I hope its right...anyway you can edit the rest to make sure it makes sense?

Code:
# TMO_AlphaHisto

#

# AlphaHisto_JQ_v2018_08_21b

#       

 

 

input Correlation_Index = "SPY";

 

def close_index = close(Correlation_Index);

def RS = if close_index == 0 then 0 else close / close_index;

rec SR = CompoundValue("historical data" = RS, "visible data" = if IsNaN(SR[1]) then RS else SR[1]);

def SRatio =  SR;

 

def new_rs = (((RS / SRatio) - 1) * 100); #...... new_rs is the histogram bars

def delta_rs = (new_rs - new_rs[1]) / AbsValue(new_rs[1]);    #....  Changed formula to include absvalue on 2018-03-02

 

 

 

# 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.

 

input length = 14;

input calcLength = 5;

input smoothLength = 3;

 

def o_TMO = new_rs[1];

def c_TMO = new_rs;

 

def data = fold i = 0 to length

with s

do s + (if c_TMO > GetValue(o_TMO, i)

then 1

else if c_TMO < GetValue(o_TMO, i)

then - 1

else 0);

def EMA5 = ExpAverage(data, calcLength);

def Main = ExpAverage(EMA5, smoothLength);

def Signal = ExpAverage(Main, smoothLength);

 

# Note Comment-Out (#) whichever scan not being used. S

# Short Scan

plot Short = (Main crosses below signal) within 2 bar;

# Long Scan


plot Long = (Main crosses above signal) within 2 bar;
 

# End Code TMO
 
BenTen

BenTen

Administrative
Staff
VIP
@HighBredCloud I don't usually scan using the custom code directly. I find it much easier to use the editor. So I can't comment on this scanner you just posted.
 
H

HighBredCloud

Active member
VIP
@BenTen Would this be it? The right way...


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, tend reversals and divergence than momentum oscillators using price.

input length = 14;
input calcLength = 5;
input smoothLength = 3;
input level = -10;

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 scan = main < level and signal < level and main > signal;

# Note Comment-Out (#) whichever scan not being used.

# Short Scan

plot Short = (Main crosses below signal) within 2 bar;

# Long Scan


plot Long = (Main crosses above signal) within 2 bar;
 

# End TMO ((T)rue (M)omentum (O)scilator) Scan
 
H

HighBredCloud

Active member
VIP
@BenTen well perhaps someone here knows...thanks anyways.
 
YungTraderFromMontana

YungTraderFromMontana

Active member
I was inspired by @markos 's overlaying of TMO's under his charts and decided to turn it into a strategy with 4 consecutive time aggregations. To my knowledge even though it is a MTF, signals are set in stone after a a closure on one of the TF's making them all one color. Even though I don't see how repaint is possible the results seem to good to be true though so I have my suspicions. Hopefully this will make up for the Heiken MTF let down :(
I'm posting two things, the strategy which utilizes 4 of these different aggregations as well as a lower study to see the changes and get a better grip on strength of momentum.
From the time I have tested it, it's clearly useful in many ways. It is amazing on every single timeframe I've tested from the 1min,2min,3min,4min setting to the 1d,2d,3d,4d setting. I really encourage you guys to test this and report back. Even though it works well it is simply going off of the change of all 4 TMO's to one color. I have not even experimented with using OB and OS conditions or using less then all 4 to confirm a signal. One thing I can say is that if I we're purely going to trade off of the strategy I'd make the sell condition more sensitive then the buy condition so it would leave trades before opening up new ones in the other direction. I'll hopefully be working along many of you to find the best settings, aggregations, pairings etc for this strategy. One last thing to note is it seems to eat volatility and print out 💸
Make sure if also use the lower study that you match the aggregations on the strategy and the study.
1d,2d,3d,4d Swing Trade Setting
https://tos.mx/cMOF38h
1m,2m,3m,4m Intraday setting
https://tos.mx/5gnsDwm
(Took heavy losses from price changes overnight but still came out with a profit.)
Feel free to change lengths, aggregations, strategy, and more and report back.
 
YungTraderFromMontana

YungTraderFromMontana

Active member
Made it even better with this simple change (exits long or short based on 2nd biggest aggregation, ex 3d, 3m), more to come.
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, muched, 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.

## "##" indicates an addition or adjustment by the OneNote Archivist
## 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.
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.DAY;
input agg2 = AggregationPeriod.FOUR_DAYS;
input agg3 = AggregationPeriod.THREE_DAYS;
input agg4 =  AggregationPeriod.TWO_DAYS;

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);

def zero = if isNaN(c) then double.nan else 0;
def ob = if isNaN(c) then double.nan else round(length * .8);
  
def os = if isNaN(c) then double.nan else -round(length * .8);


def o2 = open(period = agg2);
def c2 = close(period = agg2);
def data2 = fold i2 = 0 to length
           with s2
           do s2 + (if c2 > getValue(o2, i2)
                   then 1
                   else if c2 < getValue(o2, i2)
                        then - 1
                        else 0);

def EMA52 = ExpAverage(data2, calcLength);
def Main2 = ExpAverage(EMA52, smoothLength);
def Signal2 = ExpAverage(Main2, smoothLength);

def o3 = open(period = agg3);
def c3 = close(period = agg3);
def data3 = fold i3 = 0 to length
           with s3
           do s3 + (if c3 > getValue(o3, i3)
                   then 1
                   else if c3 < getValue(o3, i3)
                        then - 1
                        else 0);

def EMA53 = ExpAverage(data3, calcLength);
def Main3 = ExpAverage(EMA53, smoothLength);
def Signal3 = ExpAverage(Main3, smoothLength);

def o4 = open(period = agg4);
def c4 = close(period = agg4);
def data4 = fold i4 = 0 to length
           with s4
           do s4 + (if c4 > getValue(o4, i4)
                   then 1
                   else if c4 < getValue(o4, i4)
                        then - 1
                        else 0);

def EMA54 = ExpAverage(data4, calcLength);
def Main4 = ExpAverage(EMA54, smoothLength);
def Signal4 = ExpAverage(Main4, smoothLength);


plot bullish = (Main > Signal) and (Main2 > Signal2) and (Main3 > Signal3) and (Main4 > Signal4);
plot bearish = (Main < Signal) and (Main2 < Signal2) and (Main3 < Signal3) and (Main4 < Signal4);
def sellshort = (Main3 > Signal3);
def selllong = (Main3 < Signal3);
def SSS = if sellshort then 100 else if selllong then -100 else 0;
def SS = if bullish then 100 else if bearish then -100 else 0;

def sBuy = SS crosses above 0;
def sSell = SS crosses below 0;
def sbuysell = SSS crosses below 0;
def SSellbuy = SSS crosses above 0;

AddOrder(OrderType.Buy_TO_OPEN, condition = Sbuy
, price =  open[-1], 1, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "BE");

AddOrder(OrderType.Sell_TO_CLOSE, condition = sbuysell
, price = open[-1], 1, tickcolor = Color.RED, arrowcolor = Color.RED, name = "SE");

AddOrder(OrderType.Sell_to_OPEN, condition = SSell
, price =  open[-1], 1, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "BE");

AddOrder(OrderType.Buy_TO_CLOSE, condition = sSellbuy
, price = open[-1], 1, tickcolor = Color.RED, arrowcolor = Color.RED, name = "SE");
 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
The TMO indicator does not repaint. I believe you are using the wrong terminology. Due to the indicator being multi-timeframe, you would need to wait for the candle from the highest timeframe to close in order for all the signals to confirm the bias/direction it’s suggesting.

A true repaninting indicator would be the Trend Reversal and the other Linear Regression indicator that I’ve posted.
 
YungTraderFromMontana

YungTraderFromMontana

Active member
@BenTen I still consider other MTF's not this on repainting because it will give you a signal then change it. For something to not repaint in my opinion it has to give a signal and never have it change. I designed this mtf specifically knowing that using multiple aggregations preceding by 1d will make the chances of a false signal under 1 percent using the tmo. I worked around the issue with many other mtf's.

Also I'd prefer if this was its own thread because it changes the higher agg idea into a strategy and I ideally would want people to see and improve on said strategy. Name it whatever you want.
 
H

HighBredCloud

Active member
VIP
@YungTraderFromMontana FYI: There already is a 3 timeframe TMO MTF that is color coded for each time aggregation...there is also a 2 timeframe TMO MTF as well...Personally I use the 2 timeframe version because it gets to be very difficult to read especially on smaller timeframes such as 1-4 min...plus who really uses a 4 min timeframe?

 
YungTraderFromMontana

YungTraderFromMontana

Active member
I like it because it is like a wave when presented one after the other, It also kills most of the false signals if you were just using 2. I would suggest trying it. I'm not sure how you trade but you can make it work.
 
markos

markos

Well-known member
VIP
@YungTraderFromMontana I moved it here because it’s still related to the TMO multi timeframe indicator. More organized and easier for people to read.
@YungTraderFromMontana , @BenTen is correct here. We are only talking about TMO in this thread. If you want to add other indicators, then it would become a CSA in which case, you would then start a new thread. Because of the search functionality, it's always a good practice to keep like indicators together.
 
YungTraderFromMontana

YungTraderFromMontana

Active member
@YungTraderFromMontana , @BenTen is correct here. We are only talking about TMO in this thread. If you want to add other indicators, then it would become a CSA in which case, you would then start a new thread. Because of the search functionality, it's always a good practice to keep like indicators together.
Then why didn't you add this to the main TMO thread. You made a seperate one for an added aggregation.
 
CoachT

CoachT

New member
Is it possible to add Up and Down Arrows on the MTF-TMO when the Original TMO aligns with TMO of Higher Aggregation ? If so, could someone show me how this is done, I've been chasing this rabbit all day. Thanks in advance
 
YungTraderFromMontana

YungTraderFromMontana

Active member
Is it possible to add Up and Down Arrows on the MTF-TMO when the Original TMO aligns with TMO of Higher Aggregation ? If so, could someone show me how this is done, I've been chasing this rabbit all day. Thanks in advance
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, muched, 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.

## "##" indicates an addition or adjustment by the OneNote Archivist
## 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.
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.DAY;
input agg2 = AggregationPeriod.Two_DAYS;
input agg3 = AggregationPeriod.THREE_DAYS;
input agg4 =  AggregationPeriod.four_DAYS;
input agg5 =  AggregationPeriod.weeK;

def zeroline = 0;
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);

def zero = if isNaN(c) then double.nan else 0;
def ob = if isNaN(c) then double.nan else round(length * .5);
 
def os = if isNaN(c) then double.nan else -round(length * .05);


def o2 = open(period = agg2);
def c2 = close(period = agg2);
def data2 = fold i2 = 0 to length
           with s2
           do s2 + (if c2 > getValue(o2, i2)
                   then 1
                   else if c2 < getValue(o2, i2)
                        then - 1
                        else 0);

def EMA52 = ExpAverage(data2, calcLength);
def Main2 = ExpAverage(EMA52, smoothLength);
def Signal2 = ExpAverage(Main2, smoothLength);

def o3 = open(period = agg3);
def c3 = close(period = agg3);
def data3 = fold i3 = 0 to length
           with s3
           do s3 + (if c3 > getValue(o3, i3)
                   then 1
                   else if c3 < getValue(o3, i3)
                        then - 1
                        else 0);

def EMA53 = ExpAverage(data3, calcLength);
def Main3 = ExpAverage(EMA53, smoothLength);
def Signal3 = ExpAverage(Main3, smoothLength);

def o4 = open(period = agg4);
def c4 = close(period = agg4);
def data4 = fold i4 = 0 to length
           with s4
           do s4 + (if c4 > getValue(o4, i4)
                   then 1
                   else if c4 < getValue(o4, i4)
                        then - 1
                        else 0);

def EMA54 = ExpAverage(data4, calcLength);
def Main4 = ExpAverage(EMA54, smoothLength);
def Signal4 = ExpAverage(Main4, smoothLength);

def o5 = open(period = agg5);
def c5 = close(period = agg5);
def data5 = fold i5 = 0 to length
           with s5
           do s5 + (if c5 > getValue(o5, i5)
                   then 1
                   else if c5 < getValue(o5, i5)
                        then - 1
                        else 0);

def EMA55 = ExpAverage(data5, calcLength);
def Main5 = ExpAverage(EMA55, smoothLength);
def Signal5 = ExpAverage(Main5, smoothLength);


plot bullish =(Main3 > Signal3) and (Main4 > Signal4) and (Main5 < Ob);
plot bearish = (Main < Signal) and (Main2 < Signal2) and (Main3 < Signal3);
def sellshort = (Main4 > Signal4);
def selllong = (Main5 < Signal5) and (Signal5 < ob);
def SSS = if sellshort then 100 else if selllong then -100 else 0;
def SS = if bullish then 100 else if bearish then -100 else 0;

def sBuy = SS crosses above 0;
def sSell = SS crosses below 0;
def sbuysell = SSS crosses below 0;
def SSellbuy = SSS crosses above 0;

AddOrder(OrderType.Buy_TO_OPEN, condition = Sbuy
, price =  open[-1], 1, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "BE");

AddOrder(OrderType.Sell_to_Close, condition = sbuysell
, price = open[-1], 1, tickcolor = Color.RED, arrowcolor = Color.RED, name = "SE");
You can modify the bullish and bearish plots on this to get what you want. For example if you want to place an arrow when the 1d and 2d tmo's both turn green then type in this, plot bullish =(Main > Signal) and (Main2> Signal).
If you want to use different aggregation you have to change the inputs in the code.
 
YungTraderFromMontana

YungTraderFromMontana

Active member
@BenTen
I'm still kind of confused by the effects of using a multiple agg tmo's and am wondering if you could explain to me exactly this will have an effect on if used in a strategy. Here is a long term strategy I made using multiple tmo's https://tos.mx/sVl6rg3, would I have to wait past the strategy signal before making a trade? If so how much would this hamper the p/l. My mindset right now is that even if the candle on a higher agg tmo hasn't closed, it still has a coloring from the previous bar. That coloring would just carry over in the case of this strategy and therefore would entail that a buy or sell signal is given that it never changes and you would never have to wait for higher agg. tmo's to close before getting a signal.
 
BenTen

BenTen

Administrative
Staff
VIP
@YungTraderFromMontana Like I mentioned from the other post, using MTF, you still need to wait for the candle from the highest timeframe to close for the signal to be confirmed. While the candle is still being developed, anything can happen.
 
T

Thomas

Active member
My daily chart has TMO day/week,.....my weekly chart has weekly/monthly overlay,..you can

This is my main chart set up, without TMO,.....Markos, I thought I would try your Laguerre as main indicator, otherwise I use price as you can see and one last item, my lightbulb, once I viewed a video a few years back, it was my lightbulb,........I literally almost cried as the concept was so simple, my education, although Stockbee is my other guru ,
 
T

Thomas

Active member
I happed to watch that video last night, amazing!
Good for you, I spent a year and a half on Doug's site, I'm not plugging it either, but it was literally a lightbuld. Here's what hooked me, watch this one,.....https://youtu.be/9Tr3qYJUmQo Folks, you don't need to make it convoluted, difficult, to trade successfully, but you do need to focus on your set up, do a process daily and continue over and over.
 

Top