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 "Crossover" : Custom-Indicator and its Moving-Average? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
traderlees
Posted : Friday, April 17, 2009 8:01:45 PM
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.
Bruce_L
Posted : Monday, April 20, 2009 8:21:36 AM


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
traderlees
Posted : Tuesday, April 21, 2009 7:55:03 AM
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.
Bruce_L
Posted : Tuesday, April 21, 2009 8:49:21 AM


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.