[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: center of gravity oscillator



PureBytes Links

Trading Reference Links



Ehlers’ EasyLanguage coding of the CG (Center of Gravity) Oscillator (May, 
2002 TASC) employs a For command looping Length times. I know of no equivalent 
command in MetaStock’s formula language. To evaluate Ehlers’ CG Oscillator in 
MetaStock, I simply repeated Ehlers’ For loop coding 10 separate times (Length = 
10). For what it’s worth. Here it is.
Personally, I found the CG Oscillator too off and on (or inconsistent) for my 
own use.
Ehlers - COGO1
Prc := (H+L)/2;
Denom := Prc + Ref(Prc,-1) + Ref(Prc,-2) + Ref(Prc,-3) + Ref(Prc,-4) + 
Ref(Prc,-5) + Ref(Prc,-6) + Ref(Prc,-7) + Ref(Prc,-8) + Ref(Prc,-9);
Num1 := Prc;
Num2 := 2*Ref(Prc,-1);
Num3 := 3*Ref(Prc,-2);
Num4 := 4*Ref(Prc,-3);
Num5 := 5*Ref(Prc,-4);
Num6 := 6*Ref(Prc,-5);
Num7 := 7*Ref(Prc,-6);
Num8 := 8*Ref(Prc,-7);
Num9 := 9*Ref(Prc,-8);
Num10 := 10*Ref(Prc,-9);
Num := Num1+Num2+Num3+Num4+Num5+Num6+Num7+Num8+Num9+Num10;
CG := If(Denom<>0,-Num/Denom,0);
CG
Ehlers - COGO2
Prc := (H+L)/2;
Denom := Ref(Prc,-1) + Ref(Prc,-2) + Ref(Prc,-3) + Ref(Prc,-4) + Ref(Prc,-5) 
+ Ref(Prc,-6) + Ref(Prc,-7) + Ref(Prc,-8) + Ref(Prc,-9) + Ref(Prc,-10);
Num1 := Ref(Prc,-1);
Num2 := 2*Ref(Prc,-2);
Num3 := 3*Ref(Prc,-3);
Num4 := 4*Ref(Prc,-4);
Num5 := 5*Ref(Prc,-5);
Num6 := 6*Ref(Prc,-6);
Num7 := 7*Ref(Prc,-7);
Num8 := 8*Ref(Prc,-8);
Num9 := 9*Ref(Prc,-9);
Num10 := 10*Ref(Prc,-10);
Num := Num1+Num2+Num3+Num4+Num5+Num6+Num7+Num8+Num9+Num10;
CG1 := If(Denom<>0,-Num/Denom,0);
CG1
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  ----- Original Message ----- 
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From: 
  Michael 
  Gilbert 
  To: <A title=metastock@xxxxxxxxxxxxx 
  href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx 
  Sent: Saturday, April 27, 2002 4:06 
  PM
  Subject: center of gravity 
  oscillator
  
  Has anyone worked out the formula for Ehlers 
  Center of Gravity Oscillator??
   
  ---Outgoing mail is certified Virus 
  Free.Checked by AVG anti-virus system (<A 
  href="http://www.grisoft.com";>http://www.grisoft.com).Version: 6.0.351 
  / Virus Database: 197 - Release Date: 
4/19/02