Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 1/28/2008 Posts: 7
|
Support,
I know how to create custom-indicators, but how can I reference the Moving-Average of a custom-indicator in a PCF? I'm trying to identify a "crossover" of a customer-indicator and its moving avereage.
For example, let's say my custom indicator is (XAVGC10 - XAVGC20). How can I calculate a crossover of its Simple Moving-Average, say SMA-3? Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There isn't any syntax for referencing the Custom Indicator and the practicality of writing crossover formulas depends on the specific Custom Indicator. In your case it is fairly straightforward:
Custom Indicator xUp its own SMA3:
XAVGC10 - XAVGC20 > AVG(XAVGC10,3) - AVG(XAVGC20,3) AND XAVGC10.1 - XAVGC20.1 <= AVG(XAVGC10.1,3) - AVG(XAVGC20.1,3)
Custom Indicator xDn its own SMA3:
XAVGC10 - XAVGC20 < AVG(XAVGC10,3) - AVG(XAVGC20,3) AND XAVGC10.1 - XAVGC20.1 >= AVG(XAVGC10.1,3) - AVG(XAVGC20.1,3)
Custom Indicator crossing its own SMA3 (either direction):
SGN(XAVGC10 - XAVGC20 - AVG(XAVGC10,3) + AVG(XAVGC20,3)) <> SGN(XAVGC10.1 - XAVGC20.1 - AVG(XAVGC10.1,3) + AVG(XAVGC20.1,3))
You may wish to review the following:
How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
Understanding MACD
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/28/2008 Posts: 7
|
Thank you, Bruce, I appreciate the help.
I think the syntax of PCFs is a little unintuitive and I'm finding it to be cumbersome - Maybe a reference to custom indicators [as in MetaStock's Fml("Any_Custom_Indicator") function] could be provided later?
Your quick reply, though, helped me a lot. Thanks again.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |