TMO Plus Volume and Volatility For ThinkOrSwim

dart966

Member
VIP
I am a huge fan of Mobius' TMO (True Momentum Oscillator). Knowing that volume is the driving factor in moving price and that high volatility means greater price swings, I decided to apply this code to volume and volatility to create a 3 in 1 indicator. (Don't sleep on this KI and ED 😉)

I have been using this for awhile to time my entries on lower timeframes and I am very impressed with the results; therefore, with all the latest scripts posted about volatility, I decided to share my favorite indicator, The TMO Plus.

Bullish reversals are more likely when TMO is under zero (even better with a bullish divergence) and Volume and Volatility are both high (over zero).

Explanation of colors:
Price Momentum - Green/Red
Volume - Cyan/Blue
Volatility - Yellow/Orange

Shared link: TMO__Plus

See attached picture and note the highlighted oval areas:

TMO_Plus.png


Upper indicators are:

Trend Pivot Points Indicator by Mobius

Dynamic Supply and Demand Zones [AlgoAlpha] by @samer800

Code:
# TMO Plus by dart966

# Original code created by Mobius
# 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; #8
input calcLength = 5; #6
input smoothLength = 3; #6
input lineWidth = 1;


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.SetLineWeight(lineWidth);# Set line width
Signal.SetLineWeight(lineWidth);# Set line width

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



#***************************************************************************************

# TVO - True Volume Oscilator (modified TMO for volume by dart966)



input dataInput = {default volume, open_close};

input showLabels = yes;

def ov = volume;
def cv = volume;

def datav = fold iv = 0 to length
           with sv
           do sv + (if cv > GetValue(ov, iv)
                   then 1
                   else if cv < GetValue(ov, iv)
                        then - 1
                        else 0);
def EMA5v = ExpAverage(datav, calcLength);
plot Mainv = ExpAverage(EMA5v, smoothLength);
plot Signalv = ExpAverage(Mainv, smoothLength);
def sigtestv = Mainv > Signalv;

Mainv.AssignValueColor(if Mainv > Signalv
then Color.CYAN
else Color.BLUE);
Signalv.AssignValueColor(if Mainv > Signalv
then Color.CYAN
else Color.BLUE);

Signalv.HideBubble();
#Signalv.HideTitle();

AddCloud (Mainv, Signalv, Color.CYAN, Color.BLUE);


#***************************************************************************************


# True Implied Volatility Oscilator ((modified TMO for volatility by dart966)


#def imv = Sqrt(252) * stdev(log(close / close[1]), length);
def imv = impVolatility();

def oiv = imv;
def civ = imv;
def dataiv = fold iiv = 0 to length
with siv
do siv + (if civ > GetValue(oiv, iiv)
then 1
else if civ < GetValue(oiv, iiv)
then - 1
else 0);
def EMA5iv = ExpAverage(dataiv, calcLength);
plot Mainiv = ExpAverage(EMA5iv, smoothLength);
plot Signaliv = ExpAverage(Mainiv, smoothLength);
Mainiv.SetLineWeight(lineWidth);# Set line width
Signaliv.SetLineWeight(lineWidth);# Set line width

Mainiv.AssignValueColor(if Mainiv > Signaliv
then Color.GRAY
else Color.LIGHT_GRAY);
Signaliv.AssignValueColor(if Mainiv > Signaliv
then Color.YELLOW
else Color.ORANGE);
Signaliv.HideBubble();
Signal.HideTitle();
AddCloud (Mainiv, Signaliv, Color.YELLOW, Color.ORANGE);
plot zeroiv = if IsNaN(civ) then Double.NaN else 0;

plot zerov = if IsNaN(cv) then Double.NaN else 0;
zerov.SetDefaultColor(Color.GRAY);
zerov.HideBubble();
#zerov.HideTitle();


plot obv = if IsNaN(cv) then Double.NaN else Round(length * .7);
obv.SetDefaultColor(Color.GRAY);
obv.HideBubble();
obv.HideTitle();
plot osv = if IsNaN(cv) then Double.NaN else -Round(length * .7);
osv.SetDefaultColor(Color.GRAY);
osv.HideBubble();
osv.HideTitle();


DefineGlobalColor("OverBought", CreateColor(100, 40, 40));
DefineGlobalColor("OverSold", CreateColor(40, 40, 100));
AddCloud(obv, length, GlobalColor("OverBought"), GlobalColor("OverBought"));
AddCloud(-length, osv, GlobalColor("OverSold"), GlobalColor("OverSold"));

# end of script
 
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
237 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