New version 17 available now


Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

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

Seeking "elegant" Confirmation in PCF for Condition within last 5 days Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
bcochrane
Posted : Monday, January 09, 2017 5:28:31 PM
Gold Customer Gold Customer

Joined: 9/17/2010
Posts: 215

I'm trying to automate, as much as I can, an entry when the current Close is above the high of the Setup bar, where the

  1. Setup bar is a cross above STOC30 = 80 and
  2. the confirmation is a close above the high of the Setup bar within the next 5 days

My "Brute Force" PCF is:

(Stoc30.1.2 <80 AND Stoc30.1.1>80 and C>H1) or 
(Stoc30.1.3 <80 and (Stoc30.1.2 >80 and C> H2)) or 
(Stoc30.1.4 <80 and (Stoc30.1.3 >80 and C> H3)) or 
(Stoc30.1.5 <80 and (Stoc30.1.4 >80 and C> H4)) or
(Stoc30.1.6 <80 and (Stoc30.1.5 >80 and C> H5))
 
which works, but I can't help wondering if there isn't (or will be shortly?) a more elegant way to code this. I have other simialr patterns I'd like to automate as well.
 
Thanks
Bruce_L
Posted : Tuesday, January 10, 2017 8:59:12 AM


Worden Trainer

Joined: 10/7/2004
Posts: 59,203

That is probably fairly close to optimal at the moment without using a Custom PCF % True Indicator.

Condition True at Least Once Over x Bars (v16)

But there should be new syntax soon which would work without using a Custom PCF % True Indicator.

CountTrue(Stoc30.1.2 < 80 AND Stoc30.1.1 > 80 AND C > H1, 5) > 0



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
bcochrane
Posted : Tuesday, January 10, 2017 10:46:56 AM
Gold Customer Gold Customer

Joined: 9/17/2010
Posts: 215

Thanks Bruce, I'll wait (you're such a tease:-)

But a question on Condition True At Least Once - as I read it, it would test for the Setup Bar well, but I didn't see it checking for the Confirmation, closing above the specific Setup bar. Do I understand it correctly? And if I do understand it correctly, will the new syntax have the same limitation, or overcome it?

Bruce_L
Posted : Tuesday, January 10, 2017 11:11:07 AM


Worden Trainer

Joined: 10/7/2004
Posts: 59,203

Ah, yeah. Probably won't work as written. May not be able to figure out a more efficient way either, but we will see. There are significant syntax changes in current development builds that haven't made it to the company tests builds to which I have access.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
bcochrane
Posted : Wednesday, January 11, 2017 4:57:22 PM
Gold Customer Gold Customer

Joined: 9/17/2010
Posts: 215

No sweat, brute force works

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.