DDPO OBOS Price Projection Band

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

DDPO OBOS Price Projection Band

Postby fortcentral » Wed Feb 27, 2019 8:25 am

This indicator is based on the Dinapoli preferred detrended price oscillator calculation (ddpo v4.lua):
viewtopic.php?f=27&t=67266&start=20

The indicator is designed to display as a price channel/band on a price chart (see attachment). The channel indicates expected levels of market overbought/oversold based on historical oscillator extreme values. The indicator estimates levels of OB/OS for the next time period. In this way it is a leading indicator to indicate one period ahead, the price levels at which the market will be at extreme levels of OB/OS, based on historical values.

There are two channels in the display (an inner and an outer channel) consisting of the following 4 lines:
1) Max.OB - maximum overbought line based on maximum.overbought (positive) DDPO displacement within lookback period
2) %Avg.OB - user defined (%avg) percentage of average.overbought (based on average value of defined number of max peaks in the lookback period)
3) %Avg.OS - user defined (%avg) percentage of average.oversold (based on average value of defined number of min throughs in the lookback period)
4) Max.OS - maximum oversold line based on maximum.oversold (negative) DDPO displacement within lookback period


--> Price Source: Tick (default closing price, with option to also use high and low)

--> User-Input Parameters:
1) n.period - for calculation of "n.period simple moving average" in DDPO calculation - default value "7"
2) SF - Scaling factor - default value "1"
2) %avg - scaling factor applied to the calculated Avg.OB (average overbought) and Avg.OS (average oversold) values. Default value "90%"
3) Lookback period - default "100" bars
4) Max.peaks - number of the highest peaks within lookback period, for average overbought or Avg.OB calculation - default "3"
5) Min.troughs - number of the lowest troughs within lookback period, for average oversold or Avg.OS calculation - default "3"
6) Colour, style and thickness selection option for all 4 channel lines noted above
7) Option to manually input values of Max.OB, %Avg.OB, %Avg.OS and Min.OS for OBOS line calculations.

--> Calculation DDPO (as per "ddpo v4.lua"):
DDPO(time)=SF*{[Price(time)]-[n.period.SMA(time)]}

Where:
1) DDPO(time) is the current time-period DDPO oscillator value
2) SF is the scaling factor for the DDPO calculation
2) Price(time) is the current time-period high, low or closing price of the current bar depending on chosen price source
3) n.period.SMA(time) is the current time-period's "n.period simple moving average" value.

*****************************************************************
--> OB/OS price band calculation:

There are 4 lines - 2 off overbought lines and 2 off oversold lines

--> Max.OB_line calculation
Price.Max.OB_line(time+1)={[(OB.DDPO.max.disp)/(SF)]*[(n.period)/(n.period-1)]}+[(n-1).period.SMA(time)]

--> %Avg.OB_line calculation
Price.%Avg.OB_line(time+1)={[((Avg.OB)*(%avg))/(SF)]*[(n.period)/(n.period-1)]}+[(n-1).period.SMA(time)]

--> %Avg.OS_line calculation
Price.Avg.OS_line(time+1)={[((Avg.OS)*(%avg))/(SF)]*[(n.period)/(n.period-1)]}+[(n-1).period.SMA(time)]

--> Min.OS_line calculation
Price.Min.OS_line(time+1)={[(OS.DDPO.min.disp)/(SF)]*[(n.period)/(n.period-1)]}+[(n-1).period.SMA(time)]

*******************************************************************

Note:
1) "Price.xx.OB_line(time+1)" and "Price.xx.OS_line(time+1)" are the Max.OB, %Avg.OB, %Avg.OS and Min.OS "price calculations" for the next time-period. These calculated price levels form the channel lines.
2) "OB.DDPO.max.disp" is the maximum (positive) displacement or highest peak value of the DDPO calculation within the lookback period.
3) "OS.DDPO.min.disp" is the minimum (negative) displacement or lowest trough value of the DDPO within the lookback period.
4) "n.period" is the chosen period for the simple moving average calculation in the original DDPO calculation. This is part of the original user input parameters. So for example if "n.period"=7 then "(n.period-1)"=6 in the above 4 equations.
5) "SF" is the scaling factor used for the DDPO calculation.
6) (n-1).period.SMA(time) is the current time-period's "(n-1).period.SMA". So for example if "n.period"=7 then the "(n-1).period.SMA" is the "6-period.SMA" or simple moving average of the price, inclusive of the current time-period's (high, low or close) price.
7) "%Avg.OB" is the calculated percentage of average overbought value (average of the highest of the "Max.peaks" displacements within the lookback period in the DDPO calculation).
8) "%Avg.OS" is the calculated percentage of average oversold value (average of the lowest of the "Min.troughs" displacement within the lookback period in the DDPO calculation).
9) Option required for manual override to input user defined values of Max.OB, Avg.OB, Avg.OS and Min.OS - to test OBOS bands for what-if scenarios. This is particularly helpful when markets are spiking. Inputting specific historical value(s) of DDPO will produce channel lines which tend to provide OBOS guidance levels for spike moves.

Regards,
Fortcentral
Attachments
OB_OS_Channel_c.pdf
(163.5 KiB) Downloaded 490 times
fortcentral
 
Posts: 47
Joined: Wed Oct 17, 2018 9:34 am

Re: DDPO OBOS Price Projection Band

Postby Apprentice » Thu Feb 28, 2019 5:19 am

Your request is added to the development list under Id Number 4500
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: DDPO OBOS Price Projection Band

Postby fortcentral » Sun Mar 10, 2019 11:46 pm

Dear Apprentice,
Thank you again for the new indicator. I have tested it and it is very close to being complete! Please find my comments in the attachment.

Main issues noted:
1) Line 145 and Line 152 of the indicator code is missing the "sf" factor for the "avg_ob" and "avg_os" line calculations.
2) Line style selection does not appear to be working.

Also added is the request for a manual override of the auto-calculation for testing extreme moves. All this is outlined in the attachment.

Regards,
Fortcentral
Attachments
OB_OS_Channel Comments_c.pdf
(243.76 KiB) Downloaded 459 times
fortcentral
 
Posts: 47
Joined: Wed Oct 17, 2018 9:34 am

Re: DDPO OBOS Price Projection Band

Postby Apprentice » Tue Mar 12, 2019 11:50 am

Your request is added to the development list under Id Number 4536
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: DDPO OBOS Price Projection Band

Postby fortcentral » Sun Mar 17, 2019 9:14 am

Dear Apprentice,
Thank you for the update and appreciate your work as always. The OBOS bands are now stable and the line style is working perfectly. I like the way you have included for the manual over-ride option also. It gives great flexibility to vary each band individually!

Only one issue - when I select the manual mode and put in a DDPO value for a particular OBOS line calculation; that whole line is disappearing from view altogether. Could you please have a look?

Everything otherwise is working as designed.

Regards,
Fortcentral
fortcentral
 
Posts: 47
Joined: Wed Oct 17, 2018 9:34 am

Re: DDPO OBOS Price Projection Band

Postby Apprentice » Wed Mar 20, 2019 1:04 pm

Your request is added to the development list under Id Number 4557
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: DDPO OBOS Price Projection Band

Postby Apprentice » Thu Mar 21, 2019 3:47 pm

2019-03-21_13-48-47.png

It depends on what value you put in. It's likely that the value you
typed in is too high...
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: DDPO OBOS Price Projection Band

Postby fortcentral » Fri Mar 22, 2019 7:31 am

Dear Apprentice,
Yes you are correct and my apologies! I was not thorough enough. However please see attached follow-up comments. The manual calculations for %Avg.OS and Max.OS lines appear to be switched. The Max.OB and %Avg.OB lines are ok. So one last thing to fix on this.

Regards,
Fortcentral
Attachments
OBOS_Line V2 Comments_c.pdf
(204.46 KiB) Downloaded 457 times
fortcentral
 
Posts: 47
Joined: Wed Oct 17, 2018 9:34 am

Next

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 13 guests