Registered User Joined: 9/17/2010 Posts: 484
|
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
-
Setup bar is a cross above STOC30 = 80 and
-
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
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
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
|
Registered User Joined: 9/17/2010 Posts: 484
|
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?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
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
|
Registered User Joined: 9/17/2010 Posts: 484
|
No sweat, brute force works
|