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 crossover when both are going up Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
yourchef51
Posted : Monday, July 30, 2007 10:37:19 PM
Registered User
Joined: 7/1/2007
Posts: 9
I have been trying to write a pcf when the 13 day moving average crosses over the 55 day moving average and they are both going up. And then conversely when they are both going down on a separate scan. Thanks

DJ
bustermu
Posted : Tuesday, July 31, 2007 6:23:41 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
DJ,

The general form of the PCFs is:

a) MA13 upcrossing MA55 both increasing:

MA13.1<=MA55.1 AND MA55.1<MA55.0 AND MA55.0<MA10.0

b) MA13 downcrossing MA55 both decreasing:

MA13.1>=MA55.1 AND MA55.1>MA55.0 AND MA55.0>MA10.0

In the case of Simple Moving Averages (SMA) on C, the center inequality can be simplified:

a) SMA13 upcrossing SMA55 both increasing:

AVGC13.1<=AVGC55.1 AND C55<C0 AND AVGC55.0<AVGC10.0

b) SMA13 downcrossing SMA55 both decreasing:

AVGC13.1>=AVGC55.1 AND C55>C0 AND AVGC55.0>AVGC10.0

In the case of Exponential Moving Averages (EMA) on C, the center inequality can be eliminated:

a) EMA13 upcrossing EMA55 both increasing:

XAVGC13.1<=XAVGC55.1 AND XAVGC55.0<AVGC10.0

b) EMA13 downcrossing EMA55 both decreasing:

XAVGC13.1>=AVGC55.1 AND XAVGC55.0>XAVGC10.0

It may be of interest that the EMA is the one and only Linear Time Invariant (LTI) Moving Average for which the center inequality can be eliminated.

Thanks,
Jim Murphy
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.