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

PCF formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ajclarke88
Posted : Monday, August 22, 2005 6:41:20 PM
Registered User
Joined: 1/5/2005
Posts: 24
Please help me in developing a pcf that would accomplish the following:

This concerns the 10 ma and the 20 ma of price.

First: the down slope of 10ma below the 20 ma for a period of 60 days

and

Second: the crossing of the 10 ma above the 20 ms and remaining above the 20ma for 5 days.


I have tried this on my own but I just can’t get it to work!

Thanks in advance!

Tony
Craig_S
Posted : Tuesday, August 23, 2005 2:39:41 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
It would be a long PCF...

You would have to do it for all 65 days and you would only find stocks that crossed exactly 5 days ago.

(AVGC10>AVGC20)AND(AVGC10.1>AVGC20.1) AND(AVGC10.2>AVGC20.2)AND (AVGC10.3>AVGC20.3)AND(AVGC10.4>AVGC20.4)AND (AVGC10.5<AVGC20.5)AND (AVGC10.6<AVGC20.6)AND -continue with this pattern until you reach- AND (AVGC10.64<AVGC20.64)

Does that make sense?

- Craig
Here to Help!
ajclarke88
Posted : Tuesday, August 23, 2005 10:57:03 AM
Registered User
Joined: 1/5/2005
Posts: 24
I think you've got me on the right track! I will work with this and see how it turns out.

THANKS!!

TONY
bustermu
Posted : Tuesday, August 23, 2005 5:24:55 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
Tony,

The PCF given by Craig:

(AVGC10>AVGC20)AND(AVGC10.1>AVGC20.1)
AND(AVGC10.2>AVGC20.2)AND(AVGC10.3>AVGC20.3)
AND(AVGC10.4>AVGC20.4)AND(AVGC10.5<AVGC20.5)
AND(AVGC10.6<AVGC20.6)
AND...AND(AVGC10.64<AVGC20.64)

will calculate faster if rewritten as:

(AVGC10>AVGC20)*(AVGC10.1>AVGC20.1)
*(AVGC10.2>AVGC20.2)*(AVGC10.3>AVGC20.3)
*(AVGC10.4>AVGC20.4)*(AVGC10.5<AVGC20.5)
*(AVGC10.6<AVGC20.6)
*...*(AVGC10.64<AVGC20.64) <> 0

The calculation time makes little difference unless you use it as a Custom Percent True Indicator for example.

It may not be obvious that the PCF implies "the down slope of 10ma" as requested. As is shown in:

A Property of Simple Moving Averages

an equivalent PCF is:

(AVGC10.0>AVGC10.10)*(AVGC10.1>AVGC10.11)
*(AVGC10.2>AVGC10.12)*(AVGC10.3>AVGC10.13)
*(AVGC10.4>AVGC10.14)*(AVGC10.5<AVGC10.15)
*(AVGC10.6<AVGC10.16)
*...*(AVGC10.64<AVGC10.74) <> 0

In this form, we see that the Truth of the PCF implies that each 10 day SMA in the 60 day interval is less than the nonoverlapping 10 day SMA immediately preceding it. In this sense, the 10 day SMA is sloping down all though it does not decrease every day.

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.