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 Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
dwgall
Posted : Wednesday, June 8, 2005 6:34:17 PM
Registered User
Joined: 12/17/2004
Posts: 3
How do I write a PCF for 9MA crossing 13MA either up or down at yesterdays close? I have tried several but none work 100 % of the time. THANKS, Don
Doug_H
Posted : Wednesday, June 8, 2005 6:41:06 PM


Worden Trainer

Joined: 10/1/2004
Posts: 4,308
(AVGC9.2 < AVGC13.2) AND (AVGC9.1 > AVGC13.1)

This formula says that the 9 was below the 13 two days ago, but at yesterday's close, the 9 was above the 13.

You could also use the method demonstrated in the following training video:

Comparing indicators using Visual Difference sorts

- Doug
Teaching Online!
Tanstaafl
Posted : Thursday, June 9, 2005 2:32:14 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Doug's PCF will give you an UP cross.

The DOWN cross PCF would be:
(AVGC9.2 > AVGC13.2) AND (AVGC9.1 < AVGC13.1)

If you want a single PCF that fires "True" if a cross occured, but you don't care which direction, try this:
Sgn(AVGC9.2-AVGC13.2)<>Sgn(AVGC9.1-AVGC13.1)
... the SGN function returns +1/0/-1 depending on the sign of its argument

If you want a single PCF that returns +2 for a bull (up) cross OR -2 for a bear (down) cross:
Sgn(AVGC9.1-AVGC13.1) - Sgn(AVGC9.2-AVGC13.2)

Jim Dean

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.