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 |

Moving Average 4,18,40 Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Watchman
Posted : Wednesday, November 25, 2009 1:42:50 PM
Registered User
Joined: 10/7/2004
Posts: 5

Two Questions: I would like to write two PCF's....

1/  When an 18 day moving average crosses a 40 day moving average; either up or down

2/  When there is a convergence, either direction, of a 4, 18 and 40 moving average... all lines meeting at the same point

Are either of these possible?

Bruce_L
Posted : Wednesday, November 25, 2009 2:14:27 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (Watchman)
When an 18 day moving average crosses a 40 day moving average; either up or down

Please try one of the following:

SMA18 xUp SMA40:

AVGC18 > AVGC40 AND AVGC18.1 <= AVGC40.1

SMA18 xDn SMA40:

AVGC18 < AVGC40 AND AVGC18.1 >= AVGC40.1

SMA18 crossing SMA40 (either direction):

SGN(AVGC18 - AVGC40) <> SGN(AVGC18.1 - AVGC40.1)

EMA18 xUp EMA40:

XAVGC18 > XAVGC40 AND XAVGC18.1 <= XAVGC40.1

EMA18 xDn EMA40:

XAVGC18 < XAVGC40 AND XAVGC18.1 >= XAVGC40.1

EMA18 crossing EMA40 (either direction):

SGN(XAVGC18 - XAVGC40) <> SGN(XAVGC18.1 - XAVGC40.1)

QUOTE (Watchman)
When there is a convergence, either direction, of a 4, 18 and 40 moving average... all lines meeting at the same point

You could calculate the Percentage that the highest Moving Average is above the lowest Moving Average as:

Simple:

100 * ((AVGC4 + AVGC18 + ABS(AVGC4 - AVGC18) + 2 * (AVGC40) + ABS(AVGC4 + AVGC18 + ABS(AVGC4 - AVGC18) - 2 * (AVGC40))) / (AVGC4 + AVGC18 - ABS(AVGC4 - AVGC18) + 2 * (AVGC40) - ABS(AVGC4 + AVGC18 - ABS(AVGC4 - AVGC18) - 2 * (AVGC40))) - 1)

Exponential:

100 * ((XAVGC4 + XAVGC18 + ABS(XAVGC4 - XAVGC18) + 2 * (XAVGC40) + ABS(XAVGC4 + XAVGC18 + ABS(XAVGC4 - XAVGC18) - 2 * (XAVGC40))) / (XAVGC4 + XAVGC18 - ABS(XAVGC4 - XAVGC18) + 2 * (XAVGC40) - ABS(XAVGC4 + XAVGC18 - ABS(XAVGC4 - XAVGC18) - 2 * (XAVGC40))) - 1)

You could then check for this to be less than some arbitrary percentage (the following add < 1 to check for the range to be less than 1%):

Simple:

100 * ((AVGC4 + AVGC18 + ABS(AVGC4 - AVGC18) + 2 * (AVGC40) + ABS(AVGC4 + AVGC18 + ABS(AVGC4 - AVGC18) - 2 * (AVGC40))) / (AVGC4 + AVGC18 - ABS(AVGC4 - AVGC18) + 2 * (AVGC40) - ABS(AVGC4 + AVGC18 - ABS(AVGC4 - AVGC18) - 2 * (AVGC40))) - 1) < 1

Exponential:

100 * ((XAVGC4 + XAVGC18 + ABS(XAVGC4 - XAVGC18) + 2 * (XAVGC40) + ABS(XAVGC4 + XAVGC18 + ABS(XAVGC4 - XAVGC18) - 2 * (XAVGC40))) / (XAVGC4 + XAVGC18 - ABS(XAVGC4 - XAVGC18) + 2 * (XAVGC40) - ABS(XAVGC4 + XAVGC18 - ABS(XAVGC4 - XAVGC18) - 2 * (XAVGC40))) - 1) < 1

You may wish to review the following:

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)
PCF Formula Descriptions
Min Max PCFs
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.