Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF for multiple moving average convergence Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
roberttilman
Posted : Tuesday, January 12, 2010 2:25:19 PM
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.
Bruce_L
Posted : Tuesday, January 12, 2010 2:53:43 PM


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
roberttilman
Posted : Tuesday, January 12, 2010 3:16:55 PM
Registered User
Joined: 7/16/2007
Posts: 7
Thank you Bruce.
Bruce_L
Posted : Tuesday, January 12, 2010 3:46:56 PM


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.