## New version 18 available now

Subscription & data-feed pricing Class schedule

Margin rates Stock & option commissions

 TC 2000 Bull flags, Bear Flags Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
aviveros16
 Posted : Tuesday, July 24, 2012 8:33:27 PM
Registered User
Joined: 8/25/2011
Posts: 6

I am building a scanner to scan for 4 bar inside pattern, (Bull Flag or Bear Flag)

Meaning One upbar or down bar, than Inside bars, inside the up move or down move candle

The inside bars must be 50 or less percent of the up move or down move

Also the setup, to be above moving avg for Bull flag setup and below for Bear Flag setup

Example of what I have so far.

Bull Flag

((AvgC20 > AvgC50) AND ((H1<H4) AND (L1>L4) AND (H2<H4) AND (L2>L4) AND (H3<H4) AND (L3>L4)) AND (AvgL3>(.50*(H4-L4))+L4))

Bear Flag

((AvgC20 < AvgC50) AND ((H1<H4) AND (L1>L4) AND (H2<H4) AND (L2>L4) AND (H3<H4) AND (L3>L4)) AND (AvgH3<(.50*(H4-L4))+L4))

I wanted to know if I have it written correctly, I am new. I have got a few good signals but get too many signals sometimes that don't look what I am looking for

Any help will be appriciate it!

Bruce_L
 Posted : Wednesday, July 25, 2012 8:02:49 AM

Worden Trainer

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

For the most part I don't see any problems with it. There are unneccessary parentheses, but that shouldn't make it not work correctly.

I do have some possible suggestions based on the definitions you provided.

You don't seem to actually check for the up bar or down bar at the beginning of the pattern. We could define that as the close being above the open or the close being above the previous close. The following formulas use both definitions.

You have said the bars need to be "50 or less percent of the up move or down move." You are checking for the average high or low to be in the desired 50% of the range of the entire candle.

You may want to instead check for the highest high or lowest low to be within this range instead and that is what is done below.

Bull Flag

AVGC20 > AVGC50 AND H1 < H4 AND L1 > L4 AND H2 < H4 AND L2 > L4 AND H3 < H4 AND L3 > L4 AND MINL3 > (H4 + L4) / 2 AND C4 > O4 AND C4 > C5

Bear Flag

AVGC20 < AVGC50 AND H1 < H4 AND L1 > L4 AND H2 < H4 AND L2 > L4 AND H3 < H4 AND L3 > L4 AND MAXH3 < (H4 + L4) / 2 AND C4 < O4 AND C4 < C5

This may or may not be what you want. Other possibilities would be to check for the range of these bars to be less than 50% of the total range of the first bar, the net change of the first bar from previous close to close or the change from the open to close of the first bar.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Frenchy99
 Posted : Tuesday, October 23, 2018 4:42:28 PM
Registered User
Joined: 10/16/2017
Posts: 7

It's now 2018

Do you have a formula for Bullish and Bearish Flag paterns?

Bruce_L
 Posted : Tuesday, October 23, 2018 4:57:33 PM

Worden Trainer

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

Do I just have a single formula which is going to match your particular concept of a flag pattern? No, but you may wish to review the following for information on pattern recognition in TC2000 (concentrating on topics mentioning wedge, penants, triangle, and flags):

That said, I personally do not think complex pattern recognition is practical in TC2000 using formulas and Scans.

They are at the very least beyond my abilities to help you create without a specific unambiguous objective definition of what you are attempting to identify. It can't be an I know it when I see it type of definition or be based entirely on an image.

This is true of pattern recognition in general with the exception of fixed size candlestick patterns, which are fairly straightforward as long as the pattern is well defined:

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

 Forum Jump Customer Training & Support - Ask a Trainer - TC2000 version 12/18 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 18 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos 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.