Download software Tutorial videos
Subscription & data-feed pricing Class schedule

New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Scanning for Chart Patterns Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Posted : Tuesday, April 19, 2005 1:24:12 PM
Registered User
Joined: 4/19/2005
Posts: 1
Does your product provide for Chart Pattern Recognition? My interest is primarily Head & Shoulders. If your answer is "write a PCF", which I've already been told, my response is "I don't know how to write a PCF to scan for patterns." If PCF is the answer, then can I purchase that or otherwise obtain it from a third party? Are you familiar with the MetaStock Plug-in CPR and, if so, does your product offer this capability?
Posted : Tuesday, April 19, 2005 1:49:38 PM

Worden Trainer

Joined: 10/1/2004
Posts: 4,308
Pattern recognition is a possibility in TeleChart, but it is actually more complex than most people realize. Here is a link to a discussion that took place in the forums recently about this topic.

is this possible w/telechart

I think if you go out to Google and do a search on TeleChart, you'll wind up finding some links to sites where TeleChart users have shared their PCF's. Likely you'll find some that will be helpful to you.

You can also do a search here in the forum for head and shoulders, and you'll find other discussions and ideas.

I am not familiar with the MetaStock Plug-In CPR that you mentioned.

- Doug
Teaching Online!
Posted : Wednesday, March 1, 2006 8:37:23 AM
Registered User
Joined: 12/17/2004
Posts: 143
I read the above 2 comments, and the link "Is this possible with telechart". Seems to me gptacek was asking about H&S, and the link discusses ascending triangles, but I guess the point is that recognizing any pattern is difficult.

I am also trying to write code to find H&S patterns without too many charts to inspect. Taanstafl's reply in the link ID's 3 problems: (1) how to find a max/min, (2) how to define a pivot, and (3) how to count the number opf bars between pivots. My approach (which works in theory, but is being frustrated by TC's limit on how quickly it can run complex PCFs) has been to write a pcf for each combination of days.

For example, the shortest H&S PCF possible is to begin on day 1, have a shoulder peak on day 2, touch the "armpit" on day 3, create a head on day 4, touch an armpit on day 5, create the 2nd shoulder peak on day 6, and pierce the neckline on day 7. For an 8-day range, there are 3 possible PCFs. For a 9-day range, 6 possible PCFs. To not have hundreds of PCFs which ID the same chart repeatedly, I have been linking all 3 PCFs for the 8-day range into one PCF. Given each pcf involves 10 conditions linked by "and" statements, the PCFs get very long; by the 16th day, my PC complies for 45 minutes before starting to rin through charts, and then says "update complete", but the PCFs still say "not calculated".

While this approach addresses all 3 of tanstaafl's concerns, it creates a new one of being too large or cumbersome. Any suggestions re how to get around that? Thanks!
Posted : Wednesday, March 1, 2006 8:46:14 AM
Registered User
Joined: 1/28/2005
Posts: 6,049

What type lengths are you looking for in a HS pattern?
Posted : Wednesday, March 1, 2006 10:42:49 AM

Worden Trainer

Joined: 10/1/2004
Posts: 18,819
We have to define a time period for the pattern.

I tend to approach these things a little different in my own personal scanning. I build EasyScans to eliminate what could NOT be in this pattern vs. scanning for the pattern. I get my list reduced down to a reasonable number (under 300) then use the best scanning tool... my eyes and the spacebar.

Give me a rough time frame and I will give you an example of how I might scan to drop anything that cannot be a H&S.

- Craig
Here to Help!
Posted : Wednesday, March 1, 2006 1:38:06 PM
Registered User
Joined: 12/17/2004
Posts: 143
I agree we have to define a time period for the pattern. I just want to repeat the process for all possible time periods. If we can only narrow down to 300 charts per time period, I'd never finish hitting the space bar. But, maybe you can show me how to use the EZ scans, then maybe I can narrow it down with additional ideas I have? Let's say the time frame is 15 days.
Posted : Wednesday, March 1, 2006 2:16:00 PM

Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Here is my thinking:

1. A stock in a H&S will be basically flat from the start of the left shoulder to the end of the right shoulder. A stock cannot be up/down more than 8% in the last 15 days.

2. The stock must of had a decent rally and fall near the center of the 15 days to form the head.

3. The stock must meet my price and volume requirements for me to consider it.

4. Low lowest price of the recent 7 days should be close to the lowest price for teh previous 7 days

5. The stock must be in uptrend leading to the pattern.

6. The high around the center of the pattern should be higher then the highs around the beginning and end of the pattern.

Create the following PCFs:

Price Percent Change 15-day

Max as % of Min Price 15-day

Recent Lows as % of Prev Lows (15-day)

Center highs as % of flanking highs

Here is the EasyScan I created, it found 91 stocks based on yesterday's close. I estimate it takes me 2 seconds to look at a chart to know if it has formed a H&S in the past 15 days. This means it will take me less than 3-4 minutes to scan through the list. Your price and volume requirements will be different than mine, of course.

WatchList: All Stocks
Price Per Share: Value 10 to 100
Volume 90-days: List Rank 70 to 99
Price Percent Change 15-day: Value -8 to 8
Max as % of Min Price 15-day: Value 104 to MAX
Recent Lows as % of Prev Lows (15-day: Value 97 to 103
Price Percent Change 26-weeks: Value 10 to MAX
Center highs as % of flanking highs: Value: First value over 100 to MAX

I then sorted the resulting WatchList by Max as % of Min Price 15-day in descending order.

15 days is pretty short term for this pattern but here are some I found in the results that deserved a closer look:


It took me less than a minute to flip through this list.

Here is what I like about this type of loose approach:

1. I would rather see a chart and skip it with my spacebar than have the program hide the chart from me completely

2. The scan was looking for a roughly completed H&S that started and closed in the last 15 days. Because my structure was so loose I found several that formed outside of the 15 day parameter and many that looked like they may be just forming the left shoulder and head. I put these that appeared to be forming still in a WatchList to review later.

You don't have to do it the way I did. I only wanted to demonstrate my approach. Keep your EasyScans loose and err on finding more charts, not less. TeleChart gave us the great gift of the spacebar and our brain is unmatched in its ability to see patterns in a chart. Let TeleChart weed out any that could NEVER be in the pattern and let your eyes be the final scan condtion.

Make sense?

- Craig
Here to Help!
Posted : Wednesday, March 1, 2006 4:19:17 PM
Registered User
Joined: 12/17/2004
Posts: 143

Thanks so much!

I want to replicate what you've done (to ensure I did it right), then customize it to my own style. When I tried that, I got 129 stocks (small comfort: all four of those you liked best were included). Could one reason they didn't match be you wrote your PCF to limit share price between 10 and 100, while I used the EZ scan to limit a price/share pcf to between 10.17 and 102.89 (the closest values it would offer me)? In case more than one of my PCFs is off, we could compare how many stocks remain selected after each PCF is applied. We'd have to apply the PCFs in the same order; here's the order I chose:

Price/share: 4815 left
Volume 90-day: 1584
height: 1368
Price % change - 15 day: 1019
Equiv Lows: 517
Price % change 26 weeks: 219
Head > Shoulders: 129

I also have another problem which will remain even if we both get exactly 91 stocks (we're both using yesterday end of day data): I can't see the H&S pattern in the four stocks you like best. I thought the head was to be somewhere in the middle, but HMC's peak is 2 days ago, making it impossible for it to have a right shoulder, no? If I'm reading your "200*MAXH10.3/(MAXH10+MAXH10.5)" PCF coffectly, it just says the head should be greater than the average of the two shoulders. Shouldn't it have to be higher than both shoulders, or are you trying to spot them before they perice the neckline?

Posted : Wednesday, March 1, 2006 5:03:47 PM

Worden Trainer

Joined: 10/1/2004
Posts: 18,819
I noted HMC as one to note. It has no right shoulder yet (and may never have one). The fact that my method found stocks like HMC is part of what I like about it.

I did use Price Per Share. Here are my exact settings/results

WatchList: All Stocks 6865
Price Per Share: Value 10.17 to 102.89 4815
Volume 90-Day: List Rank 70 to 99 1584
Price % Change 15: Value -9.01 to 7.93 1022
Recent L as % of past L: Value 97.08 to 103.675 518
Price % Change 26wks: Value 10.179 to MAX 218
Center high vs Flanks: Value 100.0207 to MAX 91

It looks like we picked slightly different on some of the ranges. Nothing wrong with that. I tend to err on being inclusive, as I said above.

Remember, I am not as much trying to find the H&S pattern with the scan as I am trying to ELIMINATE the stocks that cannot be in the pattern. What is left are potential canditates. Most will be nothing, some may be in any stage of the pattern.

Does that help?

- Craig
Here to Help!
Posted : Wednesday, March 1, 2006 7:28:58 PM
Registered User
Joined: 12/17/2004
Posts: 143
That explains what I was missing: these are NOT completed H&S patterns.

But, I want completed patterns. You guys are all so helpful, I'm confident you'll be willing to help if I have another question while I'm developing a "completed H&S pattern" process. Thanks!
Posted : Wednesday, March 1, 2006 9:30:30 PM

Worden Trainer

Joined: 10/1/2004
Posts: 18,819
My goal is to find completed patterns.

By keeping it loose I am not letting the program hide potential ones that don't fit the exact time frame of 15 days.

My method will also find completed patterns. You can skip over the forming ones (though I like to set them aside in a WatchList). Be very careful as you tweak. If you get too restrictive you will eliminate H&S patterns your eye would of identified (if you had been allowed to see them) that don't fit the exact time periods you specify

If you did not consider any of the ones found completed then keep in mind:

1. The 15 bars is VERY short-term for a pattern like this... extend out the PCFs to cover a larger time period.

2. It is a VERY rare pattern in any time frame.

- Craig
Here to Help!
Posted : Thursday, March 2, 2006 7:41:08 AM
Registered User
Joined: 12/17/2004
Posts: 143
Last question for now: my Win98 PC is struggling to run PCFs which ID completed patterns only, for days 7-16. I agree this is very short-term, but you have to start somewhere. I am planning to upgrade PCs in the coming weeks. Whether I get a bargain model, or the top of the line depends on whether it will make these PCFs run. How much performance (MHz, RAM, etc.) do you think I need to avoid the problems (slow compiling, etc.) I cited in the 3rd post in this thread?
Posted : Thursday, March 2, 2006 7:48:49 AM

Worden Trainer

Joined: 10/1/2004
Posts: 18,819
I don't know of a magical number that will meet a certain performance. The more RAM the better is a good guideline. These days, I don't advise buying a computer with less than .5 to 1 gig in RAM

If your PCFs get too involved than they will be slow on any machine.

- Craig
Here to Help!
Posted : Thursday, June 5, 2008 2:34:33 PM
Registered User
Joined: 1/15/2007
Posts: 1
how do I write a PCF for EPS 3yr growth @20%
Posted : Thursday, June 5, 2008 3:06:00 PM

Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:

If you are new to TeleChart READ THIS FIRST!

TeleChart's Personal Criteria Formula Language does not have syntax for referencing other symbols or fundamentals. Fundamentals are limited to the built in System Criteria.

Definitions of all built in scanning and sorting criteria

It would be possible to apply growth rate to EPS Latest Qtr using Blocks with the MorningStar Historical Fundamentals & Company Stats subscription.

Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic

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.