DPO Mobo for ThinkorSwim

Hey everyone,

I've been utilizing the FW_DPO_MOBO Indicator and I would like to code it into one of my strategies. The problem is that when you go to copy and paste the script to implement it into a strategy, the script says "Source code isn't available." The TTM_Squeeze Indicator has this same problem, but I've seen reiterations of the script to make it the same as the original indicator. I was wondering if anyone has the script for the FW_DPO_MOBO Indicator that is editable and able to be coded into a strategy. I know it is a combination of Bollinger Bands and the Detrended Price Oscillator, but the original indicator somehow scales the Bollinger Bands in a special way for the Detrended Price Oscillator to work better with it. I will post the code for the FW_DPO_MOBO so you can see what I am talking about.

Any help would be much appreciated!


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2010-2020
#
# Source code isn't available.

declare lower;

input price = CLOSE;
input colorNormLength = 3;
input dpoLength = 14;
input moboDisplace = 0;
input moboLength = 10;
input numDevDn = -0.8;
input numDevUp = 0.8;
input coloredMobo = Yes;
input coloredFill = Yes;
input breakArrows = Yes;
input moboShowMid = No;

plot DPO = Double.NaN;
plot MidlineP = Double.NaN;
plot UpperBandP = Double.NaN;
plot LowerBandP = Double.NaN;
plot Zeroline = Double.NaN;
plot BreakOutArrow = Double.NaN;
plot BreakDownArrow = Double.NaN;
 

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

I don't have it all figured out but maybe this will help you with syntax:

Code:
plot myDPO = FW_DPO_MOBO().DPO;
plot myMidlineP = FW_DPO_MOBO().MidlineP;
plot myUpperBandP = FW_DPO_MOBO().UpperBandP;
plot myLowerBandP = FW_DPO_MOBO().LowerBandP;
plot myZeroline = FW_DPO_MOBO().Zeroline;
plot myBreakOutArrow = FW_DPO_MOBO().BreakOutArrow;
plot myBreakDownArrow = FW_DPO_MOBO().BreakDownArrow;
 
This is exactly what I needed! Than you very much @mfsteve!
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);
 
Hey everyone,

I've been utilizing the FW_DPO_MOBO Indicator and I would like to code it into one of my strategies. The problem is that when you go to copy and paste the script to implement it into a strategy, the script says "Source code isn't available." The TTM_Squeeze Indicator has this same problem, but I've seen reiterations of the script to make it the same as the original indicator. I was wondering if anyone has the script for the FW_DPO_MOBO Indicator that is editable and able to be coded into a strategy. I know it is a combination of Bollinger Bands and the Detrended Price Oscillator, but the original indicator somehow scales the Bollinger Bands in a special way for the Detrended Price Oscillator to work better with it. I will post the code for the FW_DPO_MOBO so you can see what I am talking about.

Any help would be much appreciated!


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2010-2020
#
# Source code isn't available.

declare lower;

input price = CLOSE;
input colorNormLength = 3;
input dpoLength = 14;
input moboDisplace = 0;
input moboLength = 10;
input numDevDn = -0.8;
input numDevUp = 0.8;
input coloredMobo = Yes;
input coloredFill = Yes;
input breakArrows = Yes;
input moboShowMid = No;

plot DPO = Double.NaN;
plot MidlineP = Double.NaN;
plot UpperBandP = Double.NaN;
plot LowerBandP = Double.NaN;
plot Zeroline = Double.NaN;
plot BreakOutArrow = Double.NaN;
plot BreakDownArrow = Double.NaN;
As the author of this study I can provide you with source code. Not sure why ToS thinks the source is secret. I've previously made it available to individuals and still do.
regards,
David
 
@davidinc @rad14733 @Shooters_Gotta_Shoot hello folks! I stumbled across this indicator in a screenshot, search gave me this thread and suffice to say the original indicators are both pretty awesome, however I wanted to customise a little (who doesnt?).
I took the code above and have made some changes but I'm seeing some differences my limited skills won't allow me to solve.

My buy signals match those in the original but I have some additional signals that need to be excluded.
Less important but still a concern is the difference between the midline in my indicator and the original where the cloud is switching from red to green....my settings match as far as i can see but the behaviour doesn't match.
I personally like the cloud background on the lowers and the midline switch is a good trigger, however my code is excluding/including a value and I'm getting gaps, not the end of the world but i know its wrong.

Any advice on how I might fix it would be very welcome!

BOAxwlh.png


link to the study is https://tos.mx/PePl8Of

Code:
#DPO_MOBO
#Based on TOS FW_DPO_MOBO

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(5);
MidlineP.AssignValueColor(if MidlineP > MidlineP[1] then Color.GREEN else Color.RED);
MidlineP.HideBubble();
MidlineP.HideTitle();

#cloud
AddCloud(if MidlineP > MidlineP[1] then Double.POSITIVE_INFINITY else Double.NaN, if MidlineP > MidlineP[1] then Double.NEGATIVE_INFINITY else Double.NaN, Color.green);
AddCloud(if MidlineP <= MidlineP[1] then Double.POSITIVE_INFINITY else Double.NaN, if MidlineP < MidlineP[1] then Double.NEGATIVE_INFINITY else Double.NaN, Color.red);

#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 UpSignal = if Dpo crosses above upperbandp then ZeroLine else Double.NaN;
UpSignal.SetHiding(!Breakarrows);
Upsignal.SetLineWeight(5);
UpSignal.SetDefaultColor(Color.WHITE);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
UpSignal.HideTitle();

alert(upsignal, "BUY", alert.once,sound.bell);
 
@BBDPDC Those gaps you are concerned with are actually quite common... If you were to review the many implementations of MOBO in both upper and lower variations you would see gaps in them as well... If your logic is working as expected then simply accept the gaps as part of normal performance... I am currently playing with a strategy based on FW_MOBO_Basic upper indicator and it also has gaps...
 
@BBDPDC Those gaps you are concerned with are actually quite common... If you were to review the many implementations of MOBO in both upper and lower variations you would see gaps in them as well... If your logic is working as expected then simply accept the gaps as part of normal performance... I am currently playing with a strategy based on FW_MOBO_Basic upper indicator and it also has gaps...
good to know thanks!

I can cope with the cloud gaps. I'm seeing the difference between the TOS indicator and the way I've cobbled mine together is pretty sketchy...there must be something missing that is smoothing the result out as the TOS version is much less choppy on the midline signals....and i still want to get rid of those extra up signals just to avoid the additional noise!
 
This indicator coupled with MACD is incredibly accurate for entry. I've not done a huge amount of testing yet but every signal for the last two days has been a winner, even if small. The exit is key however.
 
@BBDPDC The use of hl2 instead of close could very likely be the basis of the disparity you are seeing... Most MOBO and MOMO code uses close for price type...
 
Hey everyone,

I've been utilizing the FW_DPO_MOBO Indicator and I would like to code it into one of my strategies. The problem is that when you go to copy and paste the script to implement it into a strategy, the script says "Source code isn't available." The TTM_Squeeze Indicator has this same problem, but I've seen reiterations of the script to make it the same as the original indicator. I was wondering if anyone has the script for the FW_DPO_MOBO Indicator that is editable and able to be coded into a strategy. I know it is a combination of Bollinger Bands and the Detrended Price Oscillator, but the original indicator somehow scales the Bollinger Bands in a special way for the Detrended Price Oscillator to work better with it. I will post the code for the FW_DPO_MOBO so you can see what I am talking about.

Any help would be much appreciated!


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2010-2020
#
# Source code isn't available.

declare lower;

input price = CLOSE;
input colorNormLength = 3;
input dpoLength = 14;
input moboDisplace = 0;
input moboLength = 10;
input numDevDn = -0.8;
input numDevUp = 0.8;
input coloredMobo = Yes;
input coloredFill = Yes;
input breakArrows = Yes;
input moboShowMid = No;

plot DPO = Double.NaN;
plot MidlineP = Double.NaN;
plot UpperBandP = Double.NaN;
plot LowerBandP = Double.NaN;
plot Zeroline = Double.NaN;
plot BreakOutArrow = Double.NaN;
plot BreakDownArrow = Double.NaN;
Happy to provide the complete source for those that want it. It's free for individual users.
david at pc3i dot net
 
This indicator coupled with MACD is incredibly accurate for entry. I've not done a huge amount of testing yet but every signal for the last two days has been a winner, even if small. The exit is key however. what time frame you use for this indicator?
 
@davidinc @rad14733 @Shooters_Gotta_Shoot hello folks! I stumbled across this indicator in a screenshot, search gave me this thread and suffice to say the original indicators are both pretty awesome, however I wanted to customise a little (who doesnt?).
I took the code above and have made some changes but I'm seeing some differences my limited skills won't allow me to solve.

My buy signals match those in the original but I have some additional signals that need to be excluded.
Less important but still a concern is the difference between the midline in my indicator and the original where the cloud is switching from red to green....my settings match as far as i can see but the behaviour doesn't match.
I personally like the cloud background on the lowers and the midline switch is a good trigger, however my code is excluding/including a value and I'm getting gaps, not the end of the world but i know its wrong.

Any advice on how I might fix it would be very welcome!

BOAxwlh.png


link to the study is https://tos.mx/PePl8Of

Code:
#DPO_MOBO
#Based on TOS FW_DPO_MOBO

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(5);
MidlineP.AssignValueColor(if MidlineP > MidlineP[1] then Color.GREEN else Color.RED);
MidlineP.HideBubble();
MidlineP.HideTitle();

#cloud
AddCloud(if MidlineP > MidlineP[1] then Double.POSITIVE_INFINITY else Double.NaN, if MidlineP > MidlineP[1] then Double.NEGATIVE_INFINITY else Double.NaN, Color.green);
AddCloud(if MidlineP <= MidlineP[1] then Double.POSITIVE_INFINITY else Double.NaN, if MidlineP < MidlineP[1] then Double.NEGATIVE_INFINITY else Double.NaN, Color.red);

#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 UpSignal = if Dpo crosses above upperbandp then ZeroLine else Double.NaN;
UpSignal.SetHiding(!Breakarrows);
Upsignal.SetLineWeight(5);
UpSignal.SetDefaultColor(Color.WHITE);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
UpSignal.HideTitle();

alert(upsignal, "BUY", alert.once,sound.bell);
@BBDPDC @rad14733 I am currently using the script that you have shared...
What I would like to is also to configure a scan to pick up signals when
1. The middle line change from Red to Green or Green to Red but it doesn't seem to have the conditions to configure the scan
Alternative, i also tried to scan using the "DPO line to cross above the Centerline" but i cant add another condition for it to only show signals that are below the zeroline?

May I know if you have manage to scan signals when the middle line changes from Red to Green or vice versa? Or how can add a condition to only displays signals Only when it is below the Zeroline?

@BBDPDC May I also request if you can share your script that shows how the labels are plotted on your moving average?

Thank you very much
Nick
 
@rad14733 @BBDPDC
This is what I have tried again and I am to get the plot when the DPO line crosses below the midline when it is below the zero line. But still cannot figure out how to scan when the midline changes from Red to Green.

Code:
#My_FW_DPO_MOBO
#Based on TOS FW_DPO_MOBO
#Modified for personal use by rad14733
#Modified to find signals when DPO crosses above Midline when it is below zeroline
#Added level= -10
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;
input level =-10;
#plot DPO = Double.NaN;
def DPO = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).DPO;

#plot MidlineP = Double.NaN;
def MidlineP = FW_DPO_MOBO(price, colorNormLength, dpoLength, moboDisplace, moboLength, numDevDn, numDevUp, coloredMobo, coloredFill, breakArrows, moboShowMid).MidlineP;
    
plot scan = MidlineP<level and DPO < level and DPO crosses above midlineP;

Pls feel free to comment and improve this scan.
thank u
 
@Nick Have you tried using "crosses below" instead of "<" by chance...??? I haven't really checked the code because I just got off my backhoe after digging out tree stumps... I'll try to have a look later... I may be off the mark as I'm beat...
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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