Decision Point Price Momentum Oscillator For ThinkOrSwim

Could someone convert this to TOS- Decision Point Price Momentum Oscillator...it's awesome
https://www.tradingview.com/script/5e9WBJwE-DecisionPoint-Price-Momentum-Oscillator-LazyBear/

ac8JpOOw


This indicator will help traders who as the question of "can I still get in the trade when a stock is running up or dropping".
 
Last edited by a moderator:

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

Try this:
Code:
# //
# // @author LazyBear
# //
# // List of my public indicators: http://bit.ly/1LQaPK8
# // List of my app-store indicators: http://blog.tradingview.com/?p=970
# //
# study(title="DecisionPoint Price Momentum Oscillator [LazyBear]", shorttitle="DPMO_LB")
declare lower;

script nz {
    input x = 1;
    input y = 0;
    def ret = if x != 0 then x else y;
    plot nz = ret;
}

# src=input(close, title="Source")
input src = CLOSE;

# length1=input(35, title="First Smoothing")
input length1 = 35;

# length2=input(20, title="Second Smoothing")
input length2 = 20;

# siglength=input(10, title="Signal Smoothing")
input siglength = 10;

# fr=input(true, title="Fill Region")
# ehc=input(false, title="Enable Histo Color")
# ebc=input(false, title="Enable Bar Colors")
# soh=input(false, title="Show Only Histo")
# slvl=input(false, title="Show OB/OS Levels")
# oblvl=input(2.5, title="OB Level"), oslvl=input(-2.5, title="OS Level")
input oblv1 = 2.5;
input oslv1 = -2.5;

# calc_csf(src, length) =>
# sm = 2.0/length
script calc_csf {
    input src = CLOSE;
    input length = 10;

    def sm = 2 / length;
    def csf = (src - nz(csf[1])) * sm + nz(csf[1]);
    plot returnVal = csf;
}
# csf=(src - nz(csf[1])) * sm + nz(csf[1])
# csf
# i=(src/nz(src[1], src))*100
def i = (src / nz( src[1], src )) * 100;

# pmol2=calc_csf(i-100, length1)
def pmol2 = calc_csf(i - 100, length1);

# pmol=calc_csf( 10 * pmol2, length2)
def pmol = calc_csf( 10 * pmol2, length2);

# pmols=ema(pmol, siglength)
def pmols = MovAvgExponential(pmol, siglength);

# d=pmol-pmols
def d = pmol - pmols;

# duml=plot(not soh and fr?(d>0?pmol:pmols):na, style=circles, color=gray, linewidth=0, title="DummyL")
def dum1 = if d > 0 then pmol else pmols;


# plot(0, title="MidLine")
plot MidLine = 0;
Midline.SetDefaultColor(color.gray);

# hc=d>0?d>d[1]?lime:green:d<d[1]?red:eek:range
# plot(d, style=columns, color=ehc?hc:gray, transp=80, title="Histo")
plot Histo = d;
Histo.SetDefaultColor(color.light_gray);
Histo.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);

# sigl=plot(soh?na:pmols, title="PMO Signal", color=gray, linewidth=2, title="Signal")
plot PMOSignal = pmols;
PMOSignal.SetDefaultColor(Color.GRAY);

# mdl=plot(soh?na:pmol, title="PMO", color=black, linewidth=2, title="PMO")
plot PMO = pmol;
PMO.SetDefaultColor(Color.BLACK);

AddCloud(PMO, PMOSignal, color.green, color.red);
# fill(duml, sigl, green, transp=70, title="PosFill")
# fill(duml, mdl, red, transp=70, title="NegFill")
# barcolor(ebc?hc:na)
# plot(not soh and slvl?oblvl:na, title="OB Level", color=gray, linewidth=2)
# plot(not soh and slvl?oslvl:na, title="OS Level", color=gray, linewidth=2)

No guarantee that I got it all correct though.

Happy Trading,
Mashume
 
I have loaded this one to watch on the TOS mobile app. I am having problems getting indicators to read correctly on the mobile app. It may be an issue with IOS.
 
I dont know if its me or my TOS program but this only works on futures and minute charts. I have not been able to see it load on a stock chart that used ticks instead of minutes.
 
Last edited:
Both the code I wrote above, and the built-in seem to work just fine on any combination of futures (/cl, /6e), stocks (tsla, aapl), time (1m, 10m) and tick (100, 750) that I tried this morning.

-mashume
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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