TMO True Momentum Oscillator For ThinkOrSwim

@MerryDay
Hello. Could you share the link to the indicator you mentioned in this post #275 [https://usethinkscript.com/threads/...illator-for-thinkorswim.15/page-14#post-45217 Thank you and Merry X-mas

nN4mmEI.png
 
@MerryDay
Hello. Could you share the link to the indicator you mentioned in this post #275 [https://usethinkscript.com/threads/...illator-for-thinkorswim.15/page-14#post-45217 Thank you and Merry X-mas

nN4mmEI.png
That is just a visual representation of a label for the indicator in the 1st post
Alternate coloring isn't necessary when plotting the actual indicator. As the top and bottom of the oscillator is self-evident.
The alternate coloring was created for just the labels and the candles for when the lower study is not present.
 
The following thinkScript of the true momentum oscillator was created by Mobius.



L5Oru8N.png


thinkScript Code

Rich (BB code):
# 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.

declare Lower;

input length = 14;
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.red);
     Signal.AssignValueColor(if Main > Signal
                             then color.green
                             else color.red);
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
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();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);
# End Code TMO

Shareable Link

https://tos.mx/yXqNwi
How would I put an arrow when the VIX is in the os/ob zone?
 
How would I put an arrow when the VIX is in the os/ob zone?
I was curious about this too.

I personally use the TMO indicator as a confirmation tool on spotting reversals. However, I've had to manually filter (ignore) all the arrows that print that aren't in either the overbought or oversold zone.

Is there a way to modify the indicator so the arrows that print are only in the overbought/oversold zone?

This will probably save my eyes lol and really clean up my chart. Thank you in advance!
 
How would I put an arrow when the VIX is in the os/ob zone?
This indicator has no VIX calculations. That would be a new custom script. You can create a new thread. If you detail the logic map and mathematical quantitative conditions and a marked up image detailing your request, it might be possible for a member to provide the conversion to ThinkScript syntax that you would add to the 1st post.
Unsure of how to upload screenshots to the forum, Here are directions.
I was curious about this too.

I personally use the TMO indicator as a confirmation tool on spotting reversals. However, I've had to manually filter (ignore) all the arrows that print that aren't in either the overbought or oversold zone.

Is there a way to modify the indicator so the arrows that print are only in the overbought/oversold zone?

This will probably save my eyes lol and really clean up my chart. Thank you in advance!
Use the top post as it does not have arrows. Color changes are provided to show the crossings.
If you require arrows that aren't indicated by color changes and you provide the logic map and mathematical quantitative conditions for the plotting
and a marked up image detailing your request, it might be possible for a member to provide the conversion to ThinkScript syntax that you would add to the 1st post.
Unsure of how to upload screenshots to the forum, Here are directions.
 
Last edited:
@switchfire Here is a simple crossover buy/sell strategy for you to backtest. You can also take this same concept and apply it to other indicators.

Code:
# 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.
# 01/27/2020 Backtesting code added by BenTen

input length = 14;
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.red);
     Signal.AssignValueColor(if Main > Signal
                             then color.green
                             else color.red);
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
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();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);
# End Code TMO

# Backtesting Code
def buy = Main crosses above Signal;
def sell = Main crosses below Signal;

AddOrder(OrderType.BUY_AUTO, condition = buy, price = close,100, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "BUY");
AddOrder(OrderType.SELL_AUTO, condition = sell, price = close,100, tickcolor = Color.RED, arrowcolor = Color.RED, name = "SELL");

Hi Ben...this doesnt seem to line up with this............

def BUYsignal = Main crosses above Signal;
def SELLsignal = Main crosses below Signal;
addverticalline(BUYsignal,"Buy",color.green,curve.firm);
addverticalline(SELLsignal,"Sell",color.red,curve.firm);


it appears the signals generated by your strategy are like 2 days after these lines are drawn, was hoping you could help/revise so your strategy lined up so I could backtest.
 
Hi Ben...this doesnt seem to line up with this............

def BUYsignal = Main crosses above Signal;
def SELLsignal = Main crosses below Signal;
addverticalline(BUYsignal,"Buy",color.green,curve.firm);
addverticalline(SELLsignal,"Sell",color.red,curve.firm);


it appears the signals generated by your strategy are like 2 days after these lines are drawn, was hoping you could help/revise so your strategy lined up so I could backtest.
There shouldn't be a delay.
Sounds like something you may have to post an annotated image of what you are seeing along with a more detailed explanation.
Unsure of how to upload screenshots to the forum, Here are directions.
 
#TMO True Momentum Oscillator with Higher Aggregation Script and WL

#EvilSurgeon 5/16/22
#Combined Weekly and Daily into on script
#Tweeked Rising/Falling Def
#Added Breakouts
#Added arrows for crossovers
#Changed Lables per Preference
#Changed Colors Per Preference
#Combined all headers

Bugs:
1. Seems some colors over-ride others on plots and clouds, but still looks ok
2. Could not find, after lots of trial and error, a way to make weekly arrows only show up once per week (I do like when they overlap with daily though)

NOTE: Please check equations under AddLabel, AssignValueColor, and AssignBackground Color (all relatively the same), as I made some changes that may or may not be appropriate, but do seem to match up with original code.

If I did not credit a contribution appropriately, please let me know and I will update. Most, if not all, code from this thread.

All comments welcome, I am not a coder, but can piece stuff together, usually.

Script Code:

Code:
##shared_TMO_wHigherAgg_SAIMOD3_Day_Wk
#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
# TMO ((T)rue (M)omentum (O)scilator)

# Mobius, with modifications by tomsk, 1.1.2020
#with Labels and Candle Painting added by @MerryDay 12/2020
#EvilSurgeon 5/16/22
        #Combined Weekly and Daily into on script
        #Tweeked Rising/Falling Def
        #Added Breakouts
        #Added arrows for crossovers
        #Changed Lables per Preference
        #Changed Colors Per Preference
        #Combined all headers

#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.
#Original Label color assignment:
#Red    =Falling.. main < signal
#Orange =Trend is maxing out.. main > overbought
#Gray   =No trend, probable reversal..
#Cyan   =Pre-trend.. main > signal and main < oversold
#Green  =Trend is rising.. main > signal, main > oversold, main is rising, main < overbought
#BLUE   =BEGINNING TO TREND.. main > signal and main is crossing above oversold
#Yellow =END OF TREND.. main crossing below overbought

#declare lower;

input length = 14;
input calcLength = 5;
input smoothLength = 3;

input aggday = AggregationPeriod.DAY;
input aggwk = AggregationPeriod.WEEK;

def oday = open(period = aggday);
def cday = close(period = aggday);
def dataday = fold i = 0 to length
           with s
           do s + (if cday > GetValue(oday, i)
                   then 1
                   else if cday < GetValue(oday, i)
                        then - 1
                        else 0);
def EMA5day = ExpAverage(dataday, calcLength);
plot Mainday = ExpAverage(EMA5day, smoothLength);
mainday.SetLineWeight(2);
#Main.AssignValueColor(if Main > Signal
 #                          then Color.GREEN
  #                         else Color.RED);
plot Signalday = ExpAverage(Mainday, smoothLength);
signalday.SetLineWeight(2);
#Signal.AssignValueColor(if Main > Signal
                             #then Color.GREEN
                             #else Color.RED);
Signalday.HideBubble();
Signalday.HideTitle();
#AddCloud(Main, Signal, Color.LIGHT_GREEN, Color.RED);

def owk = open(period = aggwk);
def cwk = close(period = aggwk);
def datawk = fold iwk = 0 to length
           with swk
           do swk + (if cwk > GetValue(owk, iwk)
                   then 1
                   else if cwk < GetValue(owk, iwk)
                        then - 1
                        else 0);
def EMA5wk = ExpAverage(datawk, calcLength);
plot Mainwk = ExpAverage(EMA5wk, smoothLength);
mainwk.SetLineWeight(2);
#Main.AssignValueColor(if Main > Signal
 #                          then Color.GREEN
  #                         else Color.RED);
plot Signalwk = ExpAverage(Mainwk, smoothLength);
signalwk.SetLineWeight(2);
#Signal.AssignValueColor(if Main > Signal
                             #then Color.GREEN
                             #else Color.RED);
#Signal.HideBubble();
#Signal.HideTitle();
#AddCloud(Main, Signal, Color.LIGHT_GREEN, Color.RED);

plot zero = if IsNan(cday) then Double.NaN else 0;
zero.SetDefaultColor(Color.GRAY);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNan(cday) then Double.NaN else 10;
ob.SetDefaultColor(Color.GRAY);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNan(cday) then Double.NaN else -10;
os.SetDefaultColor(Color.GRAY);
os.HideBubble();
os.HideTitle();
AddCloud(ob, length, CreateColor(50, 205, 50), CreateColor(50, 205, 50), yes);
AddCloud(-length, os,CreateColor ( 240,128,128 ),CreateColor ( 240,128,128 ), yes);

#charting and formatting

DefineGlobalColor("pretrend", CreateColor(0, 255, 127));
DefineGlobalColor("TrendBEGIN", Color.DARK_GREEN);
DefineGlobalColor("TrendBrkOutUp",  CreateColor( 34, 139, 34 ) );
DefineGlobalColor("rising",   CreateColor(60, 179, 113));
DefineGlobalColor("maxxed", Color.DARK_ORANGE);
DefineGlobalColor("TrendEnd", Color.DARK_RED);
DefineGlobalColor("TrendBrkoutDwn",  Color.RED);
DefineGlobalColor("falling",  color.downtick); #CreateColor(255, 215, 0));
DefineGlobalColor("neutral", Color.YELLOW);

AddLabel(yes, "TMO Trnd Day", Color.BLUE);

AddLabel( mainday < os , "PreTrnd" , GlobalColor("pretrend") );
AddLabel( mainday > ob , "TrndMax" , GlobalColor("maxxed") );
AddLabel( mainday crosses above os , "BeginTrnd" , GlobalColor("TrendBEGIN") );
AddLabel( mainday crosses below ob , "TrndEnd" , GlobalColor("TrendEnd") );
AddLabel( mainday < signalday  , "Bearish", GlobalColor("falling") );
AddLabel( mainday >= signalday, "Bullish" , GlobalColor("rising") );
AddLabel( mainday crosses above signalday , "Trend BrkOut Up" , GlobalColor("TrendBrkOutUp") );
AddLabel( mainday crosses below signalday , "Trend Brkout Dwn" , GlobalColor("TrendBrkoutDwn") );
AddLabel( mainday < mainday[1] , "TrndDwn" , GlobalColor("falling") );
AddLabel( mainday >= mainday[1] , "TrndUp" , GlobalColor("rising") );

mainday.AssignValueColor(
if mainday < os      then GlobalColor("pretrend") else
if mainday > ob      then GlobalColor("maxxed") else
if mainday crosses above os then GlobalColor("TrendBEGIN") else
if mainday crosses below ob then GlobalColor("TrendEND") else
if mainday crosses above signalday then GlobalColor("TrendBrkOutUp") else
if mainday crosses below signalday then GlobalColor("TrendBrkoutDwn") else
if mainday < signalday then GlobalColor("falling") else
if mainday >= signalday then GlobalColor("rising") else
if mainday < mainday[1]  then GlobalColor("falling") else
if mainday >= mainday[1] then GlobalColor("rising") else
GlobalColor("neutral")) ;

signalday.AssignValueColor(
if mainday < os      then GlobalColor("pretrend") else
if mainday > ob      then GlobalColor("maxxed") else
if mainday crosses above os then GlobalColor("TrendBEGIN") else
if mainday crosses below ob then GlobalColor("TrendEND") else
if mainday crosses above signalday then GlobalColor("TrendBrkOutUp") else
if mainday crosses below signalday then GlobalColor("TrendBrkoutDwn") else
if mainday < signalday then GlobalColor("falling") else
if mainday >= signalday then GlobalColor("rising") else
if mainday < mainday[1]  then GlobalColor("falling") else
if mainday >= mainday[1] then GlobalColor("rising") else
GlobalColor("neutral")) ;

AddCloud(if mainday crosses below ob then mainday else double.nan, if mainday crosses below ob then signalday else double.nan, GlobalColor("TrendEND"), GlobalColor("TrendEND"));
AddCloud(if mainday crosses above os then mainday else double.nan, if mainday crosses above os then signalday else double.nan, GlobalColor("TrendBEGIN"), GlobalColor("TrendBEGIN"));AddCloud(if mainday > ob then mainday else double .nan , if signalday > ob then signalday else double.nan, GlobalColor("maxxed"), GlobalColor("maxxed"));
AddCloud(mainday , signalday, GlobalColor("rising"), GlobalColor("falling"));
AddCloud(if mainday < os then mainday else double.nan, if mainday < os then signalday else double.nan, GlobalColor("pretrend"), GlobalColor("pretrend"));

plot arrow =  if mainday crosses above os then mainday else Double.NaN;
arrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrow.SetDefaultColor(Color.DARK_GREEN);
arrow.SetLineWeight(4);

plot arrow2 = if mainday crosses below ob then mainday else Double.NaN;
arrow2.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
arrow2.SetDefaultColor(Color.DARK_RED);
arrow2.SetLineWeight(4);

plot arrow3_1 = if mainday crosses above signalday then mainday else double.nan;
arrow3_1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrow3_1.SetDefaultColor(Color.GREEN);
arrow3_1.SetLineWeight(4);

plot arrow4 = if mainday crosses below signalday then mainday else Double.NaN;
arrow4.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
arrow4.SetDefaultColor(Color.RED);
arrow4.SetLineWeight(4);

AddLabel(yes, " ", color.black);
AddLabel(yes, "TMO Trnd Week", Color.BLUE);

AddLabel( mainwk < os , "PreTrnd" , GlobalColor("pretrend") );
AddLabel( mainwk > ob , "TrndMax" , GlobalColor("maxxed") );
AddLabel( mainwk crosses above os , "BeginTrnd" , GlobalColor("TrendBEGIN") );
AddLabel( mainwk crosses below ob , "TrndEnd" , GlobalColor("TrendEnd") );
AddLabel( mainwk < signalwk  , "Bearish", GlobalColor("falling") );
AddLabel( mainwk >= signalwk, "Bullish" , GlobalColor("rising") );
AddLabel( mainwk crosses above signalwk , "Trend BrkOut Up" , GlobalColor("TrendBrkOutUp") );
AddLabel( mainwk crosses below signalwk , "Trend Brkout Dwn" , GlobalColor("TrendBrkoutDwn") );
AddLabel( mainwk < mainwk[1] , "TrndDwn" , GlobalColor("falling") );
AddLabel( mainwk >= mainwk[1] , "TrndUp" , GlobalColor("rising") );

mainwk.AssignValueColor(
if mainwk < os      then GlobalColor("pretrend") else
if mainwk > ob      then GlobalColor("maxxed") else
if mainwk crosses above os then GlobalColor("TrendBEGIN") else
if mainwk crosses below ob then GlobalColor("TrendEND") else
if mainwk crosses above signalwk then GlobalColor("TrendBrkOutUp") else
if mainwk crosses below signalwk then GlobalColor("TrendBrkoutDwn") else
if mainwk < signalwk then GlobalColor("falling") else
if mainwk >= signalwk then GlobalColor("rising") else
if mainwk < mainwk[1]  then GlobalColor("falling") else
if mainwk >= mainwk[1] then GlobalColor("rising") else
GlobalColor("neutral")) ;

signalwk.AssignValueColor(
if mainwk < os      then GlobalColor("pretrend") else
if mainwk > ob      then GlobalColor("maxxed") else
if mainwk crosses above os then GlobalColor("TrendBEGIN") else
if mainwk crosses below ob then GlobalColor("TrendEND") else
if mainwk crosses above signalwk then GlobalColor("TrendBrkOutUp") else
if mainwk crosses below signalwk then GlobalColor("TrendBrkoutDwn") else
if mainwk < signalwk then GlobalColor("falling") else
if mainwk >= signalwk then GlobalColor("rising") else
if mainwk < mainwk[1]  then GlobalColor("falling") else
if mainwk >= mainwk[1] then GlobalColor("rising") else
GlobalColor("neutral")) ;

AddCloud(if mainwk crosses below ob then mainwk else double.nan, if mainwk crosses below ob then signalwk else double.nan, GlobalColor("TrendEND"), GlobalColor("TrendEND"));
AddCloud(if mainwk crosses above os then mainwk else double.nan, if mainwk crosses above os then signalwk else double.nan, GlobalColor("TrendBEGIN"), GlobalColor("TrendBEGIN"));
AddCloud(if mainwk > ob then mainwk else double .nan , if signalwk > ob then signalwk else double.nan, GlobalColor("maxxed"), GlobalColor("maxxed"));
AddCloud(mainwk , signalwk, GlobalColor("rising"), GlobalColor("falling"));
AddCloud(if mainwk < os then mainwk else double.nan, if mainwk < os then signalwk else double.nan, GlobalColor("pretrend"), GlobalColor("pretrend"));

plot arrowwk =  if mainwk crosses above os then mainwk else Double.NaN;
arrowwk.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrowwk.SetDefaultColor(CreateColor(60, 179, 113));
arrowwk.SetLineWeight(4);

plot arrow2wk = if mainwk crosses below ob then mainwk else Double.NaN;
arrow2wk.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
arrow2wk.SetDefaultColor(Color.downtick);
arrow2wk.SetLineWeight(4);

plot arrow3_1wk = if mainwk crosses above signalwk then mainwk else double.nan;
arrow3_1wk.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrow3_1wk.SetDefaultColor(CreateColor(50, 205, 50));
arrow3_1wk.SetLineWeight(4);

plot arrow4wk = if mainwk crosses below signalwk then mainwk else Double.NaN;
arrow4wk.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
arrow4wk.SetDefaultColor(CreateColor(255, 215, 0));
arrow4wk.SetLineWeight(4);

# End Code

Watchlist Code:

Code:
##TMO_WL SAI MOD
#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
# TMO ((T)rue (M)omentum (O)scilator)
# Mobius, with modifications by tomsk, 1.1.2020
#with Labels and Candle Painting added by @MerryDay 12/2020
#EvilSurgeon 5/16/22
        #Added Breakouts
        #Tweeked Rising/Falling Def
        #Changed Lables per Preference
        #Changed Colors Per Preference
        #Combined all headers

#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.
#Original Label color assignment:
#Red    =Falling.. main < signal
#Orange =Trend is maxing out.. main > overbought
#Gray   =No trend, probable reversal..
#Cyan   =Pre-trend.. main > signal and main < oversold
#Green  =Trend is rising.. main > signal, main > oversold, main is rising, main < overbought
#BLUE   =BEGINNING TO TREND.. main > signal and main is crossing above oversold
#Yellow =END OF TREND.. main crossing below overbought


def length = 14;
def calcLength = 5;
def smoothLength = 3;
def tmo_ob =  10;
def tmo_os = -10;

def data = fold i = 0 to length
           with s
           do s + (if close > getValue(open, i)
                   then 1
                   else if close < getValue(open, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);
def TMO = round(main,0);
# ########################################################
#charting and formatting

#DefineGlobalColor("pretrend", CreateColor(0, 255, 127));
#DefineGlobalColor("TrendBEGIN", Color.DARK_GREEN);
#DefineGlobalColor("TrendBrkOutUp",  CreateColor( 34, 139, 34 ) );
#DefineGlobalColor("rising",   CreateColor(60, 179, 113));
#DefineGlobalColor("maxxed", Color.DARK_ORANGE);
#DefineGlobalColor("TrendEnd", Color.DARK_RED);
#DefineGlobalColor("TrendBrkoutDwn",  Color.RED);
#DefineGlobalColor("falling",  color.downtick); #CreateColor(255, 215, 0));
#DefineGlobalColor("neutral", Color.YELLOW);

AddLabel(yes, TMO + if
main crosses above tmo_os then " BeginTrnd"  else "" + if
main crosses below tmo_ob then " TrndEnd"  else "" + if
main < tmo_os then " PreTrnd" else "" + if 
main > tmo_ob then " TrndMax"  else "" + if
main < signal  then " Bearish"  else "" + if
main >= signal then " Bullish"  else "" + if
main crosses above signal then " Trend BrkOut Up"  else "" + if
main crosses below signal then " Trend Brkout Dwn"  else "" + if
main < main[1] then " TrndDwn"  else "" + if
main >= main[1] then " TrndUp"  else "", color.black);#
AssignBackgroundColor(
if main < tmo_os      then CreateColor(0, 255, 127) else
if main > tmo_ob      then Color.DARK_ORANGE else
if main crosses above tmo_os then  Color.DARK_GREEN else
if main crosses below tmo_ob then  Color.DARK_RED else
if main crosses above signal then CreateColor( 34, 139, 34 ) else
if main crosses below signal then  Color.RED else
if main < signal then  color.downtick else
if main >= signal then CreateColor(60, 179, 113) else
if main < main[1]  then  color.downtick else
if main >= main[1] then CreateColor(60, 179, 113) else
color.yellow) ;

Chart and WL images:

 
#TMO True Momentum Oscillator with Higher Aggregation Script and WL

#EvilSurgeon 5/16/22
#Combined Weekly and Daily into on script
#Tweeked Rising/Falling Def
#Added Breakouts
#Added arrows for crossovers
#Changed Lables per Preference
#Changed Colors Per Preference
#Combined all headers

Chart and WL images:

Should this only be used on Daily and Weekly Charts?
 
Hello gang. i have a question, i downloaded a great indicator from here but i could find it. please if someone know the name here will be great... TMO vertical line signal from mobius. thanks in advance
 
Is there a way to calculate the slope of the TMO "Main" and output it on the Lower indicator next to the current tmo value?
Ruby:
# 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.

declare Lower;

input length = 14;
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.red);
     Signal.AssignValueColor(if Main > Signal
                             then color.green
                             else color.red);
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
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();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);
# End Code TMO
 
Last edited by a moderator:
Scan for under -10 and red to green

#TMO True Momentum Oscilator _Mobius
#Monday, May 14, 2018 8:31 AM

## "##" indicates an addition or alteration by the Archivist
## OneNote Archive Name: TMO True Momentum Oscilator _Mobius
## Archive Section: Momentum
## Suggested Tos Name: TrueMomentumOscillator_Mobius
## Archive Date: 5.14.2018
## Archive Notes:
# Markos changed colors for cloud 01-31-19
## Original Code Follows

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

declare Lower;

input length = 14;
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.red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
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();
addCloud(ob, length, color.green, color.green, Yes);
AddCloud(data1 = -length, data2 = os, color1 = Color.RED, showBorder = yes);
# End Code TMO
 
Last edited by a moderator:
Scan for under -10 and red to green

TMO ((T)rue (M)omentum (O)scilator) Scan Scanner

Ruby:
# 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 = -15;   ##Bullish Scan
#input level = 10;   ##Bearish Scan

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

##***Bullish Scan***
plot scan = main < -10 and main>main[1] ;
 
Last edited:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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