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 |

PCFs work separately but not together Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
daledalmada
Posted : Wednesday, May 18, 2016 3:27:49 PM
Registered User
Joined: 7/5/2009
Posts: 191

When I run these two PCFs separately in  two separate easy scans,  each easy scan shows stocks that meet the individual PCFs criteria respectively.  But when I combine the two PCFs with OR into one PCF and one easy scan, I get no stocks at all.  Why is that since OR means meeting either one PCF criteria OR the other, not both?  

 

H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) (this works)

 MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90) (this works)

H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) OR MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90) (this does not work)

Bruce_L
Posted : Wednesday, May 18, 2016 3:36:17 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You need to put parentheses around the individual sub-formulas. Otherwise OR is going to get processed before AND in the order of operations.

(H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1)) OR (MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
BillÇochrane
Posted : Wednesday, May 18, 2016 3:40:18 PM
Registered User
Joined: 10/18/2012
Posts: 40

Have you tried

(H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1))

OR

(MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90))?

I added brackets around each expression to avoid confusion about AND OR sequence

Just a thought, I haven't tried it

daledalmada
Posted : Wednesday, May 18, 2016 4:04:14 PM
Registered User
Joined: 7/5/2009
Posts: 191

Thanks so much Bruce!  That did the trick!

daledalmada
Posted : Wednesday, May 18, 2016 10:35:15 PM
Registered User
Joined: 7/5/2009
Posts: 191

One final question on this Bruce.  If I wanted to add this PCF:

MAXH10.1 / MINL10.1 <= 1.05 AND (MAXH10.1 <= C10.1 * 1.05 AND MINL10.1 >= C10.1 * .90) 

To this PCF using OR:

(H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1)) OR (MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90))

Would this be correct?

(H >= 1.07 * AVGL7.1 AND MAXH7.1 < 1.07 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1) AND MINL7.1 > .93 * ((AVGH7.1 - AVGL7.1) / 2 + AVGL7.1)) OR (MAXH5.1 / MINL5.1 <= 1.05 AND (MAXH5.1 <= C5.1 * 1.05 AND MINL5.1 >= C5.1 * .90)) OR (MAXH10.1 / MINL10.1 <= 1.05 AND (MAXH10.1 <= C10.1 * 1.05 AND MINL10.1 >= C10.1 * .90))

Bruce_L
Posted : Thursday, May 19, 2016 11:55:45 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Yes, that should be correct.



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