Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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!
|
|
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
|
|
Guest-1 |