Registered User Joined: 8/31/2017 Posts: 16

Hi Bruce,
I'd like to get an EasyScan (Condition Set or whatever proper term is) alert when price closes ABOVE a MA after having closed BELOW it for some predetermined number (or flexible number of times > X) of candles. In the case of 10 candles, would the following work:
C < AVGC20 AND C1 < AVG20.1 AND C2 < AVG20.2 AND C3 < AVG20.3 AND C4 < AVG20.4 AND C5 < AVG20.5 AND C6 < AVG20.6 AND C7 < AVG20.7 AND C8 < AVG20.8 AND C9 < AVG20.9 AND C10 < AVG20.10
With thanks

Worden Trainer
Joined: 10/7/2004 Posts: 64,759

Based on your description, I would think you would want the first comparison to be creater than instead of less then.
C > AVGC20 AND C1 < AVGC20.1 AND C2 < AVGC20.2 AND C3 < AVGC20.3 AND C4 < AVGC20.4 AND C5 < AVGC20.5 AND C6 < AVGC20.6 AND C7 < AVGC20.7 AND C8 < AVGC20.8 AND C9 < AVGC20.9 AND C10 < AVGC20.10
This could be written as follows in TC2000 v17 or newer versions.
C > AVGC20 AND TrueInRow(C1 < AVGC20.1, 10) = 10
Bruce Personal Criteria Formulas TC2000 Support Articles

Registered User Joined: 8/31/2017 Posts: 16

Thank you, correct on the 1st, flubbed it when transposing.
I'll give your compact (and correct) version a try. thanks!

Platinum Customer
Joined: 10/7/2004 Posts: 785

Senior moment!!
wkly > XAvgC8 and was <XAvgC8 week before
C5>XAvgc8 and C5.1<XAvgc8 or
C5>XAvgC8 and C6<XAvgC8
Thank you

Platinum Customer
Joined: 10/7/2004 Posts: 785

I realize that the above is not the PCF I was seeking but what do those formulas represent?
Also how do I write a PCF for three consecutive highr highs and higher lows above/below 13e and 20e

Worden Trainer
Joined: 10/7/2004 Posts: 64,759

The C5.1 is incorrect and needs to be C6 as in the second version.
I am guessing you would probably also want to change the XAVGC8 to XAVGC8.5 and XAVGC8.6 instead.
C5 > XAVGC8.5 AND C6 < XAVGC8.6
Note that this represents price closing above its own exponential moving average 5 bars ago while closing below 6 bars ago.
This would be 1 week ago on a daily chart, but the exponential movinga average would be daily and not weekly in this case.
If you are interested in price crossing up through its own 8 period exponential moving average on a weekly chart in TC2000 v17, you can just set the time frame of the following to weekly.
XUP(C, XAVGC8)
In TC2000 v7, this formula would be quite a bit longer (and represents slightly different things since the weeks in v17 are calendar weeks and the weeks in v7 are rolling 5 trading day bars).
C > .32708487 * (ABS(C  C5) + 7 / 9 * (ABS(C5  C10) + 7 / 9 * (ABS(C10  C15) + 7 / 9 * (ABS(C15  C20) + 7 / 9 * (ABS(C20  C25) + 7 / 9 * (ABS(C25  C30) + 7 / 9 * (ABS(C30  C35) + 7 / 9 * (ABS(C35  C40) + 7 / 9 * (ABS(C40  C45) + 7 / 9 * (ABS(C45  C50) + 7 / 9 * (ABS(C50  C55) + 7 / 9 * (ABS(C55  C60) + 7 / 9 * (ABS(C60  C65) + 7 / 9 * (ABS(C65  C70) + 7 / 9 * (ABS(C70  C75) + 7 / 9 * (ABS(C75  C80) + 7 / 9 * (ABS(C80  C85) + 7 / 9 * (ABS(C85  C90) + 7 / 9 * (ABS(C90  C95) + 7 / 9 * (ABS(C95  C100) + 7 / 9 * (ABS(C100  C105) + 7 / 9 * (ABS(C105  C110) + 7 / 9 * (ABS(C110  C115) + 7 / 9 * (ABS(C115  C120) + 7 / 9 * (ABS(C120  C125) + 7 / 9 * (ABS(C125  C130) + 7 / 9 * (ABS(C130  C135) + 7 / 9 * (ABS(C135  C140))))))))))))))))))))))))))))) AND C5 <= .32708487 * (ABS(C5  C10) + 7 / 9 * (ABS(C10  C15) + 7 / 9 * (ABS(C15  C20) + 7 / 9 * (ABS(C20  C25) + 7 / 9 * (ABS(C25  C30) + 7 / 9 * (ABS(C30  C35) + 7 / 9 * (ABS(C35  C40) + 7 / 9 * (ABS(C40  C45) + 7 / 9 * (ABS(C45  C50) + 7 / 9 * (ABS(C50  C55) + 7 / 9 * (ABS(C55  C60) + 7 / 9 * (ABS(C60  C65) + 7 / 9 * (ABS(C65  C70) + 7 / 9 * (ABS(C70  C75) + 7 / 9 * (ABS(C75  C80) + 7 / 9 * (ABS(C80  C85) + 7 / 9 * (ABS(C85  C90) + 7 / 9 * (ABS(C90  C95) + 7 / 9 * (ABS(C95  C100) + 7 / 9 * (ABS(C100  C105) + 7 / 9 * (ABS(C105  C110) + 7 / 9 * (ABS(C110  C115) + 7 / 9 * (ABS(C115  C120) + 7 / 9 * (ABS(C120  C125) + 7 / 9 * (ABS(C125  C130) + 7 / 9 * (ABS(C130  C135) + 7 / 9 * (ABS(C135  C140) + 7 / 9 * (ABS(C140  C145)))))))))))))))))))))))))))))
I am not quite sure what three consecutive higher highs and higher lows above/below 13e and 20e means. The 3 consecutive higher highs and higher lows seems simple enough. In v17:
TrueInRow(H > H1 AND L > L1, 3) = 3
In earlier versions of TC2000 (such as v7):
H > H1 AND L > L1 AND H1 > H2 AND L1 > L2 AND H2 > H3 AND L2 > L3
But I am not sure what to check when both above and below are requested for the 13 and 20 period exponential moving averages.
Bruce Personal Criteria Formulas TC2000 Support Articles

Platinum Customer
Joined: 10/7/2004 Posts: 785

Bruce,
I was referring to higher highs and higher lows above 13e and 20e
and lower highs and lower lows below 13e & 20 e Sorry

Worden Trainer
Joined: 10/7/2004 Posts: 64,759

Higher for v17:
TrueInRow(H > H1 AND L > L1 AND L > XAVGC13 AND L > XAVGC20, 3) = 3
Lower for v17:
TrueInRow(H < H1 AND L < L1 AND H < XAVGC13 AND H < XAVGC20, 3) = 3
Higher for earlier versions:
H > H1 AND L > L1 AND L > XAVGC13 AND L > XAVGC20 AND H1 > H2 AND L1 > L2 AND L1 > XAVGC13.1 AND L1 > XAVGC20.1 AND H2 > H3 AND L2 > L3 AND L2 > XAVGC13.2 AND L2 > XAVGC20.2
Lower for earlier versions:
H < H1 AND L < L1 AND H < XAVGC13 AND H < XAVGC20 AND H1 < H2 AND L1 < L2 AND H1 < XAVGC13.1 AND H1 < XAVGC20.1 AND H2 < H3 AND L2 < L3 AND H2 < XAVGC13.2 AND H2 < XAVGC20.2
Bruce Personal Criteria Formulas TC2000 Support Articles

Platinum Customer
Joined: 10/7/2004 Posts: 785

Thank you and Merry Christmas to you and yours!

Worden Trainer
Joined: 10/7/2004 Posts: 64,759

You're welcome. Merry Christmas!
Bruce Personal Criteria Formulas TC2000 Support Articles
