FW_DPO_MOBO Script

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;
 

mfsteve

Member
VIP
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;
 

rad14733

Well-known member
VIP
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);
 

davidinc

New member
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
 

BBDPDC

Member
VIP
@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);
 

rad14733

Well-known member
VIP
@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

Member
VIP
@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!
 

BBDPDC

Member
VIP
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.
 

davidinc

New member
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
 

rad14733

Well-known member
VIP
Happy to provide the complete source for those that want it. It's free for individual users.
david at pc3i dot net

Wouldn't it be easier, and more secure for members, and more logical, for you to post the source here rather than attempting to lure members away for these forums...??? Everyone else shares their creations freely here so it should be expected of you as well... 💡
 

sunstar

New member
@mashume you are simply awesome man..! I've signed up and got the study and source code..

@davidinc - For a beginner like me, I may not understand few things that might so simple for you.. I think this forum is really great to share and help us learn
 

Nick

Active member
2019 Donor
VIP
@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
 

Similar threads

Top