Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

pcf for finding a weekly moving average (closing price) cross a week or two ago Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
fritzmiller
Posted : Wednesday, March 13, 2013 11:22:25 PM
Gold Customer Gold Customer

Joined: 1/10/2011
Posts: 4

 I'm trying to write some PCF scripts that allow me to determine when moving closing price averages crossed a number of weeks ago.  I'm interested in learning how to do this both for daily moving averages and weekly moving averages.  I think I've figured out the daily, but not the weekly.

For the daily cross, I think it's (for this example, the cross occurs sometime 2 weeks ago):
AVGC4.10 < AVGC10.10
AVGC4.5 > AVGC10.5

Then, determining that it stayed up above this week (or more precisely, today):
AVGC4 > AVGC10

How would I write this for the weekly price crossings occurring a week or two ago, instead of daily crossings?

Bruce_L
Posted : Thursday, March 14, 2013 8:30:14 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You would use a Weekly Time Frame instead of Daily Time Frame for the Condition Formula and use bars ago parameters which reflect 0, 1 and 2 weekly bars ago instead of 0, 5 and 10 daily bars ago:

AVGC4.2 < AVGC10.2 AND AVGC4.1 > AVGC10.1 AND AVGC4 > AVGC10

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



-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.