I'm working on a small application that will provide some charts and graphs to be used for technical analysis. I'm new to TA but I'm wondering if there is a way to algorithmically identify the formation of certain patterns. In most of the TA literature I've read the authors explain how to identify these patterns visually. Is there a way to algorithmically determine these patterns so that I could, for example, examine the prices in code and identify a possible Head and Shoulders pattern?
Answer
As mentioned elsewhere on this site, Lo, Mamaysky, and Wang (2000) do exactly what you're talking about, namely algorithmic detection of head and shoulders patterns. Their definition:
Head-and-shoulders (HS) and inverted head-and-shoulders (IHS) patterns are characterized by a sequence of five consecutive local extrema $E_1,...,E_5$ such that
$$ HS \equiv \begin{cases} E_1 \text{ is a maximum} \\ E_3 > E_1, E_3 > E_5 \\ E_1\text{ and }E_5\text{ are within 1.5 percent of their average} \\ E_2\text{ and }E_4\text{ are within 1.5 percent of their average,} \end{cases} $$
$$ IHS \equiv \begin{cases} E_1\text{ is a minimum} \\ E_3
No comments:
Post a Comment