DPO Mobo for ThinkorSwim

Just remember that you need to reference the FW_DPO_MOBO for every plot you want to use... I have my own custom versions and have posted my short version below... Note that my settings differ from the original release...

Ruby:
#My_FW_DPO_MOBO
#Based on TOS FW_DPO_MOBO
#Modified for personal use by rad14733

declare lower;

input price = HL2;
input colorNormLength = 3;
input dpoLength = 13;
input moboDisplace = 0;
input moboLength = 13;
input numDevDn = -1.0;
input numDevUp = 1.0;
input coloredMobo = Yes;
input coloredFill = Yes;
input breakArrows = Yes;
input moboShowMid = Yes;

#plot DPO = Double.NaN;
plot DPO = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).DPO;
#DPO.DefineColor("UpTrend", Color.LIME);
#DPO.DefineColor("DnTrend", Color.MAGENTA);
DPO.SetPaintingStrategy(PaintingStrategy.LINE);
DPO.SetLineWeight(2);
DPO.AssignValueColor(Color.YELLOW);
DPO.HideBubble();
DPO.HideTitle();

#plot MidlineP = Double.NaN;
plot MidlineP = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).MidlineP;
MidLineP.SetPaintingStrategy(PaintingStrategy.LINE);
MidLineP.SetLineWeight(2);
MidlineP.AssignValueColor(if MidlineP > MidlineP[1] then Color.GREEN else Color.RED);
MidlineP.HideBubble();
MidlineP.HideTitle();

#plot UpperBandP = Double.NaN;
plot UpperBandP = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).UpperBandP;
UpperBandP.SetDefaultColor(Color.WHITE);
UpperBandP.SetLineWeight(1);

#plot LowerBandP = Double.NaN;
plot LowerBandP = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).LowerBandP;
LowerBandP.SetDefaultColor(Color.WHITE);
LowerBandP.SetLineWeight(1);

#plot Zeroline = Double.NaN;
plot Zeroline = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).Zeroline;
Zeroline.SetStyle(Curve.MEDIUM_DASH);
Zeroline.SetDefaultColor(Color.ORANGE);
Zeroline.SetLineWeight(2);


#plot BreakOutArrow = Double.NaN;
plot BreakOutArrow = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).BreakOutArrow;


#plot BreakDownArrow = Double.NaN;
plot BreakDownArrow = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).BreakDownArrow;

AddCloud(UpperBandP, LowerBandP, Color.MAGENTA, Color.MAGENTA);
I can't find the link for this indicator.
 
I use the one here from @rad14733: https://usethinkscript.com/threads/fw_dpo_mobo-script.4771/#post-44180. He does use different lengths.
This indicator appears on most of my charts. I buy dips and then look for reversals.
I am not a fan of arrows, especially w/ oscillators, especially w/ this particular script. For me, it is more about how the oscillator is lining up with your other three non-collinear indicators on your three timeframes.
This is very interesting @MerryDay , and @rad14733
I find your MomentumBreakout function fascinating and your explanations you shared enlightening.

This learnings here might be applied to others analogous problems as well.
https://www.seeitmarket.com/using-momentum-bands-with-a-risk-on-ratio-filter/

In particular I think I might use this with our relative volume studies to understand how mobile an volume might be. Or rather why some unusual volumes are more restless than others.
https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/post-136003

Thank you and have a happy new year.
 
How do I convert an AddCloud Statement into a variable TOS?

AddCloud(if DPO > lower then upper else nan,
if DPO > lower then lower else nan, Color.Green, Color.Current);
 
Last edited by a moderator:
How do I convert an AddCloud Statement into a variable TOS?

AddCloud(if DPO > lower then upper else nan,
if DPO > lower then lower else nan, Color.Green, Color.Current);

Your request is: Create a definition for when your cloud is green? Which indicates that the DPO is greater than the lower boundary.
def variable = DPO > Lower ;

If you are looking for a signal for when the cloud begins to turn green:
plot trigger = if DPO crosses above Lower then Lower else double.NaN;
trigger.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
trigger.SetDefaultColor(color.yellow) ;
trigger.SetLineWeight(3);[

lb5zM5A.png

Ruby:
#https://www.tradingview.com/script/s2yv2eub-Mobo-Bands/
declare lower;
def price  = hl2;
def colorNormLength = 3;
def dpoLength       = 13;
def moboDisplace    = 0;
def moboLength    = 10;
def numDevDn  = -0.8;
def numDevUp  = 0.8;
script nz {
    input data = 0;
    def ret_val = if IsNaN(data) then 0 else data;
    plot return = ret_val;
}
def coloredMobo     = yes;
def coloredFill     =  yes;
def breakArrows     = yes;
def moboShowMid     = yes;


#def DPO = price - Average(price[DPO_length / 2 + 1], DPO_length);
def xsma = Average(price[dpoLength / 2 + 1], dpoLength);
#def xsma = sma(price, dpoLength);
def DPO = price - xsma;


def Midline = Average(DPO, moboLength);

def sDev = StDev(DPO, moboLength);

def Lower = Midline + numDevDn * sDev;
def Upper = Midline + numDevUp * sDev;

plot line_dpo = DPO;
line_dpo.AssignValueColor(if  line_dpo>  line_dpo[1] then Color.cyan else Color.red);
line_dpo.SetLineWeight(5);
plot Line_mid = Midline;
Line_mid.AssignValueColor(if MidLine < dpo then Color.green else Color.magenta);
Line_mid.SetLineWeight(3);

AddCloud(if DPO > Lower then Upper else double.NaN,
if DPO > Lower then Lower else double.NaN, Color.Green, Color.Current);

plot trigger = if DPO crosses above Lower then Lower else double.NaN;
trigger.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
trigger.SetDefaultColor(color.yellow) ;
trigger.SetLineWeight(3);
 
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
350 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