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

Formula correction needed. Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
wagster
Posted : Sunday, April 23, 2017 4:38:18 PM
Registered User
Joined: 3/19/2005
Posts: 1

I would like to know if this formula is written correctly.  NR7 in an uptrend

((AVGC10  >= AVG20) OR (AVGC20 >= AVG50)) AND ((H <= H1) AND (H1 <= H2)) OR ((C <= C1) AND (C1 <= C2)) AND ((H - L) <= (H1- L1)) AND ((H - L) <= (H2 - L2)) AND ((H - L) <= (H3 - L3)) AND ((H - L) <= (H4 - L4)) AND ((H - L) <= (H5 - L5)) AND ((H - L) <= (H6 - L6))

Getting an error

Thanks

Bruce_L
Posted : Monday, April 24, 2017 12:42:21 PM


Worden Trainer

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

The NR7 part can be written as follows in TC2000 v17.

H - L < MIN(H1 - L1, 6)

And as follows in earlier versions of TC2000.

H - L < H1 - L1 AND H - L < H2 - L2 AND H - L < H3 - L3 AND H - L < H4 - L4 AND H - L < H5 - L5 AND H - L < H6 - L6

Your version allows for equality, so you can change the < to <= if you would prefer.

The portion of your formula which checks for an uptrend is:

AVGC10 >= AVGC20 OR AVGC20 >= AVGC50

You may want to switch this to AND and get rid of the equality.

This portion checks for either the highs or closes of the two most recent bars to not be going down. This could be part of a definition of an uptrend, so we will leave it in, but require both.

This could be written as follows in TC2000 v17.

TrueInRow(H >= H1 AND C >= C1, 2) = 2

But it isn't much longer in older versions of TC2000 (which will also work in TC2000 v17).

H >= H1 AND C >= C1 AND H1 >= H2 AND C1 >= C2

So the formula I would get for TC2000 v17 would be the following.

H - L < MIN(H1 - L1, 6) AND TrueInRow(H >= H1 AND C >= C1, 2) = 2 AND AVGC10 > AVGC20 AND AVGC20 > AVGC50

This would be the following in earlier versions of TC2000.

H - L < H1 - L1 AND H - L < H2 - L2 AND H - L < H3 - L3 AND H - L < H4 - L4 AND H - L < H5 - L5 AND H - L < H6 - L6 AND H >= H1 AND C >= C1 AND H1 >= H2 AND C1 >= C2 AND AVGC10 > AVGC20 AND AVGC20 > AVGC50

I'm not really sure any of this is a "correction" if you didn't like you previous results, but we would need further clarification from you as to the pattern you are actually trying to identify to change much else.



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