Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Request for Detrended Price Oscillator Formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
SageRx
Posted : Tuesday, March 21, 2017 8:45:23 PM
Registered User
Joined: 10/7/2004
Posts: 110

Hi Bruce ;

Need a PCF that identifies the current bar Detrended Price Oscillator (21 Peiod) as having twice the value of the previous bar.

                                                                                 Thank you

Bruce_L
Posted : Wednesday, March 22, 2017 8:32:38 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Please keep in mind that DPO can cross through and even equal zero when using this formula. Anything which goes from at or below zero to a positive value will qualify.

C - AVGC21.12 >= 2 * (C1 - AVGC21.13)

If you wanted to compare the magnitude and make sure the sign remained the same without being zero, then you would use something like the following instead.

ABS(C - AVGC21.12) >= 2 * ABS(C1 - AVGC21.13) AND SGN(C - AVGC21.12) = SGN(C1 - AVGC21.13) AND C <> AVGC21.12

Detrended Price Oscillator (DPO)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SageRx
Posted : Thursday, March 23, 2017 11:57:49 AM
Registered User
Joined: 10/7/2004
Posts: 110

Bruce

Thank you for the DPO21 formula. I ended up using the one with ABS and SGN components. What I noticed about the scan results was the trajectory of DPO21 on the current bar. While technically the condition was being satisfied the current bar "leg" could be displayed as a relatively flat trajectory or the bar could be spiking hard to the upside and to confound matters  further respective values (previous bar DPO21 to current bar DPO21) from sample set to sample set could often times be rather close so there was'nt a real correlation between value differances and tragectory results of the current bar DPO21. So now the question is, is it possible to have a stand alone Pcf which would identify only the upward trajectory of the current bar DPO21 when that bar is spiking hard to the upside at an 85 degree angle or more?

                                                                                                

Bruce_L
Posted : Thursday, March 23, 2017 12:09:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

No, because an 85 degree angle is completely and totally meaningless. The angle in degrees is going to change based on the scroll, zoom, and even things like the aspect ratio of the pane in which the DPO is being plotted.

What you could check for as how far the DPO as % of the total range of DPO over say 50 bars. The following formula will only work in TC2000 v17+.

100 * (C - AVGC21.12 - C1 + AVGC21.13) / (MAX(C - AVGC21.12, 50) - MIN(C - AVGC21.12, 50))

Higher values would represent steeper angles (at least if there were 50 bars visible on the chart). You should initially use this as a sort in order to find out what values meet your angle requirements (assuming this does in fact do what you want). You can then create a condition for the value being greater than whatever threshold you decide upon.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SageRx
Posted : Thursday, March 23, 2017 1:45:41 PM
Registered User
Joined: 10/7/2004
Posts: 110

I'am getting a formula error message

Bruce_L
Posted : Thursday, March 23, 2017 1:55:23 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I don't really have a way to re-write this exact formula for TC2000 v12, but we can use the range in closing prices as a fairly decent proxy for the range of the DPO to use in the denominator.

100 * (C - AVGC21.12 - C1 + AVGC21.13) / (MAXC50 - MINC50)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SageRx
Posted : Thursday, March 23, 2017 3:07:02 PM
Registered User
Joined: 10/7/2004
Posts: 110

I'am getting zero hits from this formula over all time frames and various random value inputs, perhaps I'am applying the formula incorrectly?

Bruce_L
Posted : Thursday, March 23, 2017 3:21:01 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

It returns a value. You should use it as a WatchList Column and sort initially. The highest values should have the steepest angles (although this assumes both that the number of bars on the chart matches the formula - 50 - and that the difference between the highest close and the lowest close is a good approximation of the difference between the highest DPO and the lowest DPO).

Once you have determined some sort of threshold that constitutes the type of angle you want, you can then create a Condition Formula.

For example, if you decided anything greater than 20 was a steep enough angle you would use:

100 * (C - AVGC21.12 - C1 + AVGC21.13) / (MAXC50 - MINC50) > 20



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SageRx
Posted : Wednesday, April 5, 2017 9:34:24 AM
Registered User
Joined: 10/7/2004
Posts: 110

Bruce

Thank you for that latest round of the DPO21 formula.  After much testing with it, I now have it at a place where it returns meaningful information. 

Bruce_L
Posted : Wednesday, April 5, 2017 9:35:02 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.