Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
8 mai 2009 5 08 /05 /mai /2009 08:48



l'oscillateur CG centre de gravité de John Ehlers.

http://translate.google.be/translate?prev=hp&hl=fr&js=n&u=http%3A%2F%2Fwww.jamesgoulding.com%2FResearch_II%2FEhlers%2FEhlers%2520%28CG%2520Oscillator%29.doc&sl=en&tl=fr

http://www.jamesgoulding.com/Research_II/Ehlers/Ehlers%20(CG%20Oscillator).doc


De toutes façons   NO STRESS



////////////////centre gravité John Ehlers
/////////////////

// variable = n - par défaut =10

sum = 0
wgt = 0

b=(customclose)  // défaut =medianprice

FOR i = 0 TO n - 1
 sum = sum + (1 + i) * b[i]
 wgt = wgt + b[i]
NEXT

IF wgt <> 0 THEN
 cG =( - sum / wgt)  + ( (n+1)/2)
 
 
ENDIF


RETURN cg as"centre gravité",cg[1] as "trigger",0 as "zero"

/////////////////////////fin

Partager cet article

Repost 0
Published by SOHOCOOL - dans John Ehlers
commenter cet article

commentaires

francois 16/01/2011 00:23


J'ai trouvé la formule ci-dessous mais ce n'est pas l'originale.

The indicator:


{ James Sibbet's Demand Index Indicator }
{ Programmed by David Fenstemaker }
{ The Demand Index combines price and volume in }
{ such a way that it is often a leading indicator of }
{ price change. }

Inputs: Length(5);

Vars: DMIndx(0);

DMIndx = DeMand.Index (Length) ;

Plot1(DMIndx, "DMI") ;
Plot2(0, "Zero") ;

{ James Sibbet's Demand Index Function }
{ Programmed by David Fenstemaker }
{ The Demand Index combines price and volume in }
{ such a way that it is often a leading indicator of }
{ price change. }


The function:

Inputs: Length (NumericSeries);

Vars : WtCRatio(1), VolRatio(1), VolAvg(Volume),
BuyP(1), SellP(1), Sign(+1), Return(0),
WghtClose(Close), AvgTR(High - Low),
Constant(1), BuyPres(1), SellPres(1),
TempDI(1), DMI(1);

If CurrentBar = 1 then
Begin
VolAvg = Average(Volume, Length);
End;

Return = 0 ;

WghtClose = (High + Low + Close + Close) * 0.25;
AvgTR = Average (Highest (High, 2) - Lowest ( Low, 2), Length);
VolAvg = ((VolAvg [1] * (Length - 1)) + Volume) / Length;

If WghtClose 0 and WghtClose[1] 0 and
AvgTR 0 and VolAvg 0 then
Begin
WtCRatio = (WghtClose - WghtClose[1]) / MinList(WghtClose,
WghtClose[1]) ;
VolRatio = Volume / VolAvg;
Constant = ((WghtClose * 3) /AvgTR) * AbsValue (WtCRatio);
If Constant > 88 then Constant = 88;
Constant = VolRatio / ExpValue (Constant);
If WtCRatio > 0 then
Begin
BuyP = VolRatio;
SellP = Constant;
End
Else
Begin
BuyP = Constant;
SellP = VolRatio;
End;

BuyPres = ((BuyPres [1] * (Length - 1)) + BuyP) / Length;
SellPres = ((SellPres [1] * (Length - 1)) + SellP) / Length;

TempDI = +1;

If SellPres > BuyPres then
Begin
Sign = -1;
If SellPres 0 then TempDI = BuyPres / SellPres;
End
Else
Begin
Sign = +1;
If BuyPres 0 then TempDI = SellPres / BuyPres;
End;

TempDI = TempDI * Sign;
If TempDI < 0
then
DMI = -1 - TempDI
else
DMI = +1 - TempDI ;

Return = DMI {* 100.0} ;

End;






Lance Fisher wrote:

> Romi,
>
> >From pg. 243 of Trading Systems and Methods by P. Kaufman.
>
> "...The technique bears a resemblance to the approach used in Wilder's RSI.
> It can be used as an oscillator with individual daily values or accumulated
> into an index. The individual days are calculated as:
>
> @sum(upside volume, 10)
> Demand Index = -------------------------
> @sum(downside volume, 10)
>
> where @sum is a function that sums the past 10 days of upside and downside
> volume..."
>
> Basically, the formula stated in english is - "The sum of upside volume for
> the past ten days, divided by, the sum of downside volume for the past ten
> days"
>
> The EL code would go something like...
>
> Vars: DI(0),
> UpSum(0),
> DnSum(0);
>
> UpSum = Summation(High of Data2, 10); {Or wherever it is that contains the
> upside volume data}
> DnSum = Summation(Low of Data2, 10) {Or wherever it is that contains the
> downside volume data}
>
> DI = IFF(DnSum 0, UpSum / DnSum, DI[1]);
>
> Plot1(DI, "DemandIndex");
>
> Cheers,
>
> -Lance
>

François


SOHOCOOL 16/01/2011 10:17



Merci ,je vais essayé de traduire ce code.


@+


 



francois 15/01/2011 17:16


Merci

Ci-dessous une formule (que j'ai fait) pour Metastock que je trouve intéressante.

Mov(BuyP()- SellP(),5,S)

Le BuyP() et Sell() sont des extrais du Demande Index.

François


SOHOCOOL 15/01/2011 18:30



Bonsoir François,


je n'ai pas la formule du Demand Index .(je ne crois pas qu elle soit disponible ??) 


salutations


Philippe



francois 15/01/2011 04:07


Bonjour,

La programmation c'est du chinois pour moi.
Est-ce que la formule pour le CG est disponible pour Metastock ?

François


SOHOCOOL 15/01/2011 08:59



Bonjour François,


le CG de John Ehlers est ici :


http://trader.online.pl/MSZ/e-w-Center_of_Gravity_Oscillator_JE.html


Ps: C'est Le code pour une période de 10 Medianprice uniquement.


      Il faut faut tracer une horizontale à 5.50 .(10+1)/2


 


@+