Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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
|
|
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?
|
|
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
|
|
Registered User Joined: 10/7/2004 Posts: 110
|
I'am getting a formula error message
|
|
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
|
|
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?
|
|
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
|
|
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.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |