Registered User Joined: 12/13/2004 Posts: 4
|
I have a pcf for 8dma xing 20dma which works fine, but I want it to show only crossovers in the past two days. This part I cannot seem to do. Any help would be appreciated. Tnx.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A formula for the 8-Period Simple Moving Average crossing up through the 20-Period Simple Moving Average could be written as:
AVGC8 > AVGC20 AND AVGC8.1 <= AVGC20.1
So a formula for this happening within the most recent two Bars could be written as:
(AVGC8 > AVGC20 AND AVGC8.1 <= AVGC20.1) OR (AVGC8.1 > AVGC20.1 AND AVGC8.2 <= AVGC20.2)
A formula for the 8-Period Simple Moving Average crossing down through the 20-Period Simple Moving Average could be written as:
AVGC8 < AVGC20 AND AVGC8.1 >= AVGC20.1
So a formula for this happening within the most recent two Bars could be written as:
(AVGC8 < AVGC20 AND AVGC8.1 >= AVGC20.1) OR (AVGC8.1 < AVGC20.1 AND AVGC8.2 >= AVGC20.2)
A formula for the 8-Period Simple Moving Average crossing through the 20-Period Simple Moving Average in either direction could be written as:
SGN(AVGC8 - AVGC20) <> SGN(AVGC8.1 - AVGC20.1)
So a formula for this happening within the most recent two Bars could be written as:
SGN(AVGC8 - AVGC20) <> SGN(AVGC8.1 - AVGC20.1) OR SGN(AVGC8.1 - AVGC20.1) <> SGN(AVGC8.2 - AVGC20.2)
If either or both of the Moving Averages are Exponential instead of Simple, you would need to change each instance of:
AVGC
In the formula for any Exponential Moving Average in the formula to:
XAVGC
Moving Average PCF Templates
Things to check if your moving averages don't "seem right" or "seem to match"
How to create a Personal Criteria Forumula (PCF)
Using EasyScan to find stocks that meet your own criteria
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|