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 |

Have been trying to create a PCF and Scan re: crossing 200 Moving Average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ucsense
Posted : Wednesday, February 16, 2011 2:24:35 PM
Registered User
Joined: 12/12/2006
Posts: 77
Have been trying to create a PCF and Scan re: price crossing up thru the 200 Moving Average within the last 1 or 2 days with a volume of at least 250K (and, also, a 1.5 increase in volume over the last 5 day  volume average) but the chart doesn't cooperate with my desires (imagine that). 

Obviously, there are several things I have missed here. Please send help as this has me pulling hair out...

This is what I developed but in many instances I find the price far above the 200 MA:

AVGC200 > AVGC200.1 AND AVGC200.1 > AVGC200.2 C > AVGC200 V >= 1.1 * V1 AND V1 >= 1.1 * V2 TSV > TSV1.1 MS > MS1.1 V >= 2500 1 <= C AND C <= 200 AND V >= 2500

I also need a formula to find price moving down through the 200 Moving Average with the same volume parameters.  Simple MA is fine in all instances.. 

If you could supply these for me, I could possibly learn to create formulas on my own.....

Thank you!!!

ucsense1
Bruce_L
Posted : Wednesday, February 16, 2011 2:37:33 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Well if Price has crossed up through its Moving Average in the last 1 or 2 days days, then it is above its Moving Average (well possibly not if it crossed back down, but let's ignore that for the moment since I suspect you want it to still be above) :

C > AVGC200

It also had to be below its Moving Average either yesterday or the day before:

C1 < AVGC200.1 OR C2 < AVGC200.2

I'm a little unclear on if the Volume of at least 250k and the increase in Volume are for the current Bar or the Bar of the cross, but let's assume the current Bar for now (and that the Average Volume includes the current Bar as well):

V >= 2500 AND V >= 1.5 * AVGV5

So the resulting formula would be:

C > AVGC200 AND (C1 < AVGC200.1 OR C2 < AVGC200.2) AND V >= 2500 AND V >= 1.5 * AVGV5

If the only thing that changes is that Price is crossing down, than we just need to swap the first three > and < signs:

C < AVGC200 AND (C1 > AVGC200.1 OR C2 > AVGC200.2) AND V >= 2500 AND V >= 1.5 * AVGV5

Changes in how these requirements are interpreted would change the formula as well.

How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Moving Average PCF Templates
Things to check if your moving averages don't "seem right" or "seem to match"
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
ucsense
Posted : Wednesday, February 16, 2011 4:10:51 PM
Registered User
Joined: 12/12/2006
Posts: 77

THANK YOU, Bruce! Quick question: How long did it take for you to answer this? - actual time working on the formula? (I just want to see how long I must work with this to be 1/2 as fast as you are.....

Bruce_L
Posted : Wednesday, February 16, 2011 4:20:38 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Writing the answer took quite a bit longer than the formula... several minutes. The formula itself (which I wrote first and then broke down into its components to explain resulting in the longer post) took about 15 seconds to create and type.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
ucsense
Posted : Wednesday, February 16, 2011 11:09:09 PM
Registered User
Joined: 12/12/2006
Posts: 77

One more question...

How would I use this formula on Stockfinder 5?

Thanks!

 

ucsense1

Bruce_L
Posted : Thursday, February 17, 2011 8:01:19 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You wouldn't as StockFinder does not use TeleChart's Personal Criteria Formula Language, it uses RealCode. Any formula would have to be re-written in RealCode. The first completed formula would be:

If Price.Last > Price.AVGC(200) AndAlso _
     (Price.Last(1) < Price.AVGC(200, 1) OrElse _
     Price.Last(2) < Price.AVGC(200, 2)) AndAlso _
     Volume.Value >= 2500 AndAlso _
     Volume.Value >= 1.5 * Volume.AVG(5) Then Pass

While the second completed formula would be:

If Price.Last < Price.AVGC(200) AndAlso _
     (Price.Last(1) > Price.AVGC(200, 1) OrElse _
     Price.Last(2) > Price.AVGC(200, 2)) AndAlso _
     Volume.Value >= 2500 AndAlso _
     Volume.Value >= 1.5 * Volume.AVG(5) Then Pass

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