# Traders.com

Mon12092013

Last update09:42:00 AM

## Head & Shoulders, Algorithmically, Part 2

Crossing The (Neck)line

In part 1, we looked at how to find important milestone points in a head & shoulders formation. In this, the second article of a two-part series, we present an algorithm that will let the computer find the formations for us.

In Figure 1, you can see what I call milestone points for a completed closing-price head & shoulders (H&S) formation — that is, an H&S formation generated by the closing price where it has penetrated the neckline. However, these milestones are defined regardless of whether there is an H&S pattern present. In this article, I will elaborate on the necessary conditions that these points must meet in order to outline an H&S. Being aware of these conditions will help you create an identification algorithm.

FIGURE 1: MILESTONE POINTS IN A HEAD & SHOULDERS FORMATION. The red points are milestones for the H&S since connecting them one after the other provides an outline of the formation. They also facilitate the creation of an identification algorithm.

METRICS AND NOTATIONS
Before delving into the conditions, I will define some of the important points and metrics (see Figure 2):

• V is the highest closing price during the time span between L0 and H1
• W is the highest closing price during the time span between L3 and the last closing price
• The time distance (number of bars) between H1 and H will be called Dist1 and the time distance between H and H2 will be called Dist2
• The time distance between L0 and L1 will be called Dist1#, the time distance between L1 and L2 will be called Dist#, and the time distance between L2 and L3 will be called Dist2#
• t1 will be the time distance between H1 and L1 and t2 will be the time distance between L2 and H2.

THE CONDITIONS
The first condition has to do with the vertical distance relationship between H1 and H as well as between H2 and H. We want H1 to be sufficiently higher than L1, but not too close to H.

…Continued in the May issue of Technical Analysis ofStocks & Commodities

Excerpted from an article originally published in the May 2013 issue of Technical Analysis ofStocks & Commodities magazine. All rights reserved. © Copyright 2013, Technical Analysis, Inc.

### More Articles...

To read the entire issue click here and subscribe today!

DEPARTMENTS: Advertising | Editorial | Circulation | Employment | Contact Us | BY PHONE: (206) 938-0570

Join us on Facebook     Follow us on Twitter

Copyright © 1996-2013 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.