Registered User Joined: 8/9/2005 Posts: 5
|
I have written a pcf that is supposed to return stocks which have at least matched the 30 day high in the last 10 days and then closed below the 10 and 20 day simple moving averages. Unfortunately, I also get some stocks which don't meet my criteria, but are "close". I can't figure out where my mistake is in the following formula:
((MAXH10) = (MAXH30)) AND (( < (AVGC10)) AND ( < AVGC20)))
Some of the returns are stocks which have closed below the 10, but not the 20. agcy and gisx (as of yesterday) are examples of this. agcy is now below, but it wasn't yesterday when I got the return.
Thankyou for your help.
John
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Lets start by simplifying your PCF a bit
MAXH10=MAXH30 AND C<AVGC10 AND C<AVGC20
I will assume agcy is actually ACGY
Based on the 9/8 close:
ACGY met your conditions
MAXH10=19.12 MAXH30=19.12 C=17.64 AVGC10=18.101 AVGC20=17.6865
GISX also meets your condtions
MAXH10=22.21 MAXH30=22.21 C=21.41 AVGC10=21.631 AVGC20=21.4345
Go through this checklist to see why your plotted moving averages are not confirming your PCF. Keep in mind your PCF is for simple moving averages.
Things to check if your moving averages don't "seem right" or "seem to match"
- Craig Here to Help!
|