Registered User Joined: 6/5/2006 Posts: 39
|
Hi, I want to create a pcf that will give me na adx reading above thirty (with a period of fourteen and an average of fourteen.) I have noticed that people have asked for adx pcf's in the past and that it is hard to find a practical way of devising one. My idea is that if a pcf could read + and - DI values, then the difference could be calculated between the two values for each of the last fourteen trading days and averaged.(I don't know if the ADX uses simple or exponential averaging, another potential problem) If the system dosn't give adx readings, hopefully a mock indicator could be created around plus and minus DI values. While I can sort by adx readings, narrowing down the lists givin to me by my easy scans would drastically help my trading. Thank you very much for your help. Best Regards, Brian Bernstein
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Calculating the difference between a 14-Period +DI and -DI requires more than 17,000 characters for the degree of accuracy I would normally use for ADX type calculations.
If you did a 14-Period Simple Moving Average of this, you would end up with more 240,000 characters in the formula.
If you did a 14-Period Exponential Moving Average of this instead, you would end up with more than 850,000 characters using 49-Periods of +DI and -DI values.
ADX uses Wilder's Smoothing. Wilder's Smoothing is a type of Exponential Smoothing requiring even more bars of data for the same accuracy when using the same period. This would require about 94-Periods of +DI and -DI values for the same accuracy resulting in a formula size in excess of 1,640,000 characters.
Now there are plenty of optimizations that can be used to shorten the formulas. Calculating using shorter, less accurate versions of Wilder's Smoothing at all stages being the most straightforward. You can also decrease the accuracy of the calculations for older +DI and -DI values because of their decreasing contribution to the results.
No matter how many optimizations I have applied, I have not been able to bring it down to a practical formula length however. The Windows clipboard will only copy and paste 32768 characters at a time. Even if it could copy more, formulas of this length will grind PCF calculation almost to a halt on most computers.
You may wish to review the following:
PCF for Wilder's Directional Movement DMI-crossovers PCF for Wilder's DX, and/or a CI for Wilder's ADX
It should probably be mentioned that this type of filtering is much simpler and quicker using Blocks.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|