See following site...
http://www.harmonictrader.com/excerpt2ht.htm
Also see a code from Jose's site which is called harmoinic pattern indicator.
You may want to tweak the code to suit your requirement....
MetaStock -> Tools -> Indicator Builder -> New
Copy and paste formula below.
===========================
Harmonic Pattern Correlator
===========================
---8<---------------------------
{ Stock/Harmonic Pattern correlator v1.0 }
{ Plot on own window below price chart }
{ Zoom out & cycle trough stocks }
{ Search for meaningful patterns }
{ ©Copyrite 2004 Jose Silva }
{
http://www.metastocktools.com }
xshift:=Input("x wave shift (0~100)%",
0,100,50)/100+1;
yshift:=Input("y wave shift (0~100)%",
0,100,33.333333)/100+1;
zshift:=Input("z wave shift (0~100)%",
0,100,20)/100+1;
scalar:=Input("Scalar (1-100)",1,100,33.333333);
x:=Sin(Power(Cum(1/H),xshift));
y:=Sin(Power(Cum(1/L),yshift));
z:=Cos(Power(Cum(1/C),zshift));
odd:=Cum(1)/2=Int(Cum(1)/2);
pattern:=If(odd,x+y-z,x-y+z)*scalar;
pattern
---8<---------------------------
http://www.metastocktools.com