Thread: GC Oscillator
View Single Post
  #2 (permalink)  
Old 11-04-2005, 06:13 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up It's a great example!

Quote:
Originally Posted by forexts
http://www.forex-tsd.com/showpost.ph...0&postcount=23

I think this oscillator (documented in Ehlers section), is a very good exercise for this section.

In fact I think we could develop as much indicators from Ehlers as possible.

Figure 1. Easy Language Code to Compute the CG Oscillator

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");
Forexts,

Thank you very much for your suggestion; it's really a very good exercise.
It will be our next lesson.

At the same time the Oscillator's name starts with my name's first letters CG (Center of Gravity) (Coders' Guru)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote