PureBytes Links
Trading Reference Links
|
Hi Marc,
This is what I have about the COG
Center of Gravity [Ehlers]
{J.Ehlers Center of Gravity: TASC 5/2002}
Num:= MP();
Num:= Num + (2 * Ref(MP(),-1));
Num:= Num + (3 * Ref(MP(),-2));
Num:= Num + (4 * Ref(MP(),-3));
Num:= Num + (5 * Ref(MP(),-4));
Num:= Num + (6 * Ref(MP(),-5));
Num:= Num + (7 * Ref(MP(),-6));
Num:= Num + (8 * Ref(MP(),-7));
Num:= Num + (9 * Ref(MP(),-8));
Num:= Num + (10 * Ref(MP(),-9));
Denom:= MP();
Denom:= Denom + Ref(MP(),-1);
Denom:= Denom + Ref(MP(),-2);
Denom:= Denom + Ref(MP(),-3);
Denom:= Denom + Ref(MP(),-4);
Denom:= Denom + Ref(MP(),-5);
Denom:= Denom + Ref(MP(),-6);
Denom:= Denom + Ref(MP(),-7);
Denom:= Denom + Ref(MP(),-8);
Denom:= Denom + Ref(MP(),-9);
CG:= (Num / Denom) * -1;
CG1:= Ref(CG,-1);
CG;
CG1
I hope this is what you are looking for.
Carlos.
=
--- merle oiseau <daqnaz@xxxxxxxx> wrote:
>
> Please, can someone help me to program the CG
> oscillator of J.Ehlers in Metastock language.
>
> Thanks for your helping,
>
> Marc.
>
>
>
> Inputs: Price((H+L)/2),
>
> Length(10);
>
>
>
> Vars: count(0),
>
> Num(0),
>
> Denom(0),
>
> CG(0);
>
>
>
> Num = 0;
>
> Denom = 0;
>
> For count = 0 to Length - 1 begin
>
> Num = Num + (1 + count)*(Price[count]);
>
> Denom = Denom + (Price[count]);
>
> End;
>
> If Denom <> 0 then CG = -Num/Denom;
>
>
>
> Plot1(CG, "CG");
> Plot2(CG[1], "CG1");
>
>
>
> ---------------------------------
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et
> en français !
> Testez le nouveau Yahoo! Mail
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|