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

explantion of foumula for "gappers" Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
pslarry
Posted : Thursday, May 23, 2013 6:26:45 PM
Registered User
Joined: 3/13/2005
Posts: 19

Could you explain the logic for the gappers formula with the result being numeric: 0,1,2?   formula: -1 * (L>H1) + -2* (H<L1)   How is the <,> boolean used in the numeric formula resulting in "gap up" or "gap down"?     I would like to find only  gap ups.

Bruce_L
Posted : Friday, May 24, 2013 8:05:30 AM


Worden Trainer

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

If you put a boolean (true or false) expression inside of parentheses in a formula which will return a numeric value, true will return -1 and false will return 0. So:

-1 * (L > H1)

Returns 1 when there is a gap up and 0 otherwise while:

-2 * (H < L1)

Returns 2 when there is a gap down and 0 otherwise. Adding these results together creates a formula which returns 1 when there is a gap up, 2 when there is a gap down and 0 otherwise.

If you just want to identify gap ups using a Condition Formula, the formula would be much simpler:

L > H1

This checks for the low of the current bar being greater than the high of the previous bar.

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
pslarry
Posted : Friday, May 24, 2013 3:32:24 PM
Registered User
Joined: 3/13/2005
Posts: 19

Thanks Bruce for prompt, clear reply and valuable links.  Earl S.

Bruce_L
Posted : Friday, May 24, 2013 3:35:30 PM


Worden Trainer

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

You're welcome.



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