TMO with Higher Agg_Mobius @ TSL

@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.
 
@BenTen Thats the indicator I used to create the arrows I provided above. what I am struggling with it creating a strategy from this or a study from this which signals correctly. The problem is that if one arrow shows a signal (up or down), I need to hold that signal until it signals the opposite signal and this is where I think I am running into a problem with my code. I confirmed I am doing this by plotting the alert and it is not matching the arrows. I need to write something where if there is a cross the value is 1 and it stays one until this is another cross in the opposite direction.
 
Last edited:
@trouble56 Are you saying that the signals you see manually don't match the signals that the indicator generated? If so, can you share some screenshots?
 
@BenTen The signals I am seeing from Maya's study is not matching the study I created, which I posted above. here is a picture showing the problems

xvRFblp.jpg
 
@BenTen here are the 2 conditions:

Def LongUP = Crosses(main, signal, CrossingDirection.ABOVE);
Def ShortDOWN = Crosses(main, signal, CrossingDirection.BELOW);

I am looking for the value of ALERT to equal 1 when LongUP occurs and have it keep that value until ShortDOWN occurs then when that happens I want the value of ALERT to be equal to -1 and then I want it to keep that value until LongUP occurs and on and on
 
@trouble56 Here you go:

Code:
# My version of so called "blackFLAG FTS PLATINUM Ver. 5.0" @Maya
# 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.HOUR;

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);
# End Code TMO with Higher Aggregation

def bullish = Main crosses above Signal;
def bearish = Main crosses below Signal;

plot bullish_signal = if bullish then 1 else 0;
plot bearish_signal = if bearish then -1 else 0;
 
Hi Everyone,

I'm having some difficulties with the following codes and hoping someone can offer a suggestion.

I have the following label code added to a script for the momentum change.

AddLabel (yes, "Mom Change ", if main > main from 1 bars ago then color.GREEN else if main < main from 1 bars ago then color.RED else color.YELLOW);

Then I have the following one added to my watchlist as a column
main.assignValueColor(if main > main from 1 bars ago then color.GREEN else if main < main from 1 bars ago then color.RED else color.YELLOW);

The aggregation time is set to daily for both, but the colors don't match. Please, can someone tell me where I'm going wrong?
 
Last edited by a moderator:
@generic You have to place it in the TMO indicator. Something like if time is between xyz then exclude data or candles.
 
In trying to put together a scanner that shows names with all TMO's compressing and heading upwards, With my VERY limited knowledge, this is as far as i've been able to get with it. most versions of the scanner did not return much results but this one I think I might have found a sweet spot... PLEASE if anyone has any ideas to show names where all TMO's are scooping (turning green from the bottom up) together (or consecutively) please feel free to let me know cause i'm actually pretty frustrated with this since either the previous version would show too few results or show the signal had appeared 3-5 days prior... Here's the scanner:

https://tos.mx/eE5Lpm1
This might be a good addition to your chart as I noticed most of the scan result showed volatility squeeze. by the way, it is different than TTM squeeze.

Code:
#Plots a Volatility Squeeze from a higher aggregation period.  The channel plot allows you to quickly see which way price is expanding from the squeeze
###########

Addlabel(1, "Vol Squeeze", color.white);
# Volatility Squeeze: Standard Deviation
# Mobius
# Chat Room Discussion 12.19.2016
# V02.06.16.2018
# Add UI for Higher Aggregation. Added Channel Plot. Added UI controls for Channel Plot, Heritage Points and Label.

input n = 13; #hint n: Length for Standard Deviation calculations
input agg = AggregationPeriod.Fifteen_Min; #hint agg: 2 to 10 times higher than chart agg.
input DisplayChannel = yes;
input HeritagePoints = yes;
input Label = yes;

def h = high(period = agg);
def l = low(period = agg);
def c = close(period = agg);
def x = barNumber();
def nan = double.nan;
def m = Average(c, n);
def SD = stDev(c, n);
def u = m + SD;
def d = m - SD;
def W = (u - d) / m;
def hW = highest(w, n);
def lW = lowest(w, n);
def R = (w - lW) / (hW - lW);
def sq1 = if R crosses below .001
          then hl2
          else sq1[1];
def sqh = if R crosses below .001
          then h
          else sqh[1];
def sql = if R crosses below .001
          then l
          else sql[1];
def sqx = if R crosses below .001
          then x
          else nan;
plot sq = if HeritagePoints and R <= 0
          then sq1
          else double.nan;
     sq.SetStyle(Curve.Points);
     sq.SetLineWeight(3);
     sq.SetDefaultColor(Color.Yellow);
     sq.HideBubble();
     sq.HideTitle();
plot upper = if DisplayChannel and x >= HighestAll(sqx)
             then HighestAll(if isNaN(c[-1])
                             then sqh
                             else nan)
             else nan;
     upper.SetStyle(Curve.Long_Dash);
     upper.SetLineWeight(2);
     upper.SetDefaultColor(Color.Green);
     upper.HideBubble();
     upper.HideTitle();
plot lower = if DisplayChannel and x >= HighestAll(sqx)
             then HighestAll(if isNaN(c[-1])
                             then sql
                             else nan)
             else nan;
     lower.SetStyle(Curve.Long_Dash);
     lower.SetLineWeight(2);
     lower.SetDefaultColor(Color.Red);
     lower.HideBubble();
     lower.HideTitle();
addCloud(lower, upper, color.light_orange, color.light_orange);
addLabel(Label, if R > .9
            then "Vol Expanding: " + R
            else if R < .01
                 then "Squeeze: " + R
            else "Drift: " + R,
            if R < .01
            then color.red
            else if R > .9
                 then color.green
                 else color.white);
# End Code
 
@YungTraderFromMontana I was trying out this indicator in real trading and it looks like the signal "repaints" in some scenarios. I believe it is not technically a repaint as it waits for confirmation from higher time frames.
 
@scalper81 Correct, that is not repainting but rather just the fluctuation when waiting for the higher timeframe candle to close.
 

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 124

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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