TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum
Customer Training & Support
Ask a Trainer - TC2000 version 12/18
TC 2000 Bull falgs, Bear Flags
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.
((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))
((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!
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.
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
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.
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!