Registered User Joined: 7/16/2007 Posts: 7
|
I've been trying to write a PCF Custom Percent True Indicator that will spike when any three of the following four indicators get within 1.5% of each other.
8 day Simple MA, 20 day Simple MA, 50 Day Exponential MA and 200-day Exponential MA.
Any help would be greatly appreciated. The formula I've written says it takes 1001 days to calculate so I've obviously done something wrong...
Thank you for your time.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No, that doesn't necessarily mean there is anything wrong. The 200-Period Exponential Moving Average would require about that much data for its calculations. Here's what I come up with (it's probably possible to make something shorter):
(AVGC8 + AVGC20 + ABS(AVGC8 - AVGC20) + 2 * (XAVGC50) + ABS(AVGC8 + AVGC20 + ABS(AVGC8 - AVGC20) - 2 * (XAVGC50))) / (AVGC8 + AVGC20 - ABS(AVGC8 - AVGC20) + 2 * (XAVGC50) - ABS(AVGC8 + AVGC20 - ABS(AVGC8 - AVGC20) - 2 * (XAVGC50))) <= 1.015 OR (AVGC8 + AVGC20 + ABS(AVGC8 - AVGC20) + 2 * (XAVGC200) + ABS(AVGC8 + AVGC20 + ABS(AVGC8 - AVGC20) - 2 * (XAVGC200))) / (AVGC8 + AVGC20 - ABS(AVGC8 - AVGC20) + 2 * (XAVGC200) - ABS(AVGC8 + AVGC20 - ABS(AVGC8 - AVGC20) - 2 * (XAVGC200))) <= 1.015 OR (AVGC8 + XAVGC50 + ABS(AVGC8 - XAVGC50) + 2 * (XAVGC200) + ABS(AVGC8 + XAVGC50 + ABS(AVGC8 - XAVGC50) - 2 * (XAVGC200))) / (AVGC8 + XAVGC50 - ABS(AVGC8 - XAVGC50) + 2 * (XAVGC200) - ABS(AVGC8 + XAVGC50 - ABS(AVGC8 - XAVGC50) - 2 * (XAVGC200))) <= 1.015 OR (AVGC20 + XAVGC50 + ABS(AVGC20 - XAVGC50) + 2 * (XAVGC200) + ABS(AVGC20 + XAVGC50 + ABS(AVGC20 - XAVGC50) - 2 * (XAVGC200))) / (AVGC20 + XAVGC50 - ABS(AVGC20 - XAVGC50) + 2 * (XAVGC200) - ABS(AVGC20 + XAVGC50 - ABS(AVGC20 - XAVGC50) - 2 * (XAVGC200))) <= 1.015
You may wish to review the following:
Min Max PCFs
How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 7/16/2007 Posts: 7
|
Thank you Bruce.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|