Overblog
Suivre ce blog Administration + Créer mon blog
22 décembre 2011 4 22 /12 /décembre /2011 19:21

Bonjour à tous,

 

Voici ,la traduction en language PRT du code de Elder's fait par José Silva ,c'est une

 

 interpretation.

 

Le lien : http://trader-online.tk/MSZ/e-w-Elders_AutoEnvelope.html

 

 

Code Prorealtime.

 

 

//////////////////////SOHOCOOL
///////////////////////ELDER 'S AUTO ENVELOPES PROREALTIME
///////////////////////28  AOUT 2011
{Elder's AutoEnvelope by Jose Silva


{Dr A. Elder's AutoEnvelope interpretation v1.0
Differs from the original in that it avoids
the use of the hindsight-based LastValue()
MetaStock function.
www.elder.com/MetaStock/AutoEnvelope.htm

http://www.metastocktools.com }

{ User inputs }
{pds:=Input("EMA periods",1,252,21);
pdsBak:=Input("lookback periods",1,252,42);
x:=Input("use: Open=1, High=2, Low=3, Close=4, WClose=5",1,5,4);
plot:=Input("[1]AutoEnvelope, [2]Long signals, [3]All signals",1,3,1);
delay:=Input("Entry/Exit signals delay",0,5,0);

{ Price field }
{x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),C))));
    
    { Envelope bands
    Avg:=Mov(x,pds,E);
    hiAvg:=HHV(H,pdsBak);
    loAvg:=LLV(L,pdsBak);
    shift:=
    Mov(If(hiAvg>Avg,hiAvg-Avg,Avg-loAvg),pds,E);
     UpperBand:=Avg+shift;
     LowerBand:=Avg-shift;}
     
     
     ///variable pds = périodes de la moyenne exponentielle (défaut =22)
     ///variable pdsback = période du canal donchian (défaut = 44) (le double).
     
     
     //price field
     
     x = customclose
     { Envelope bands }
     Avg= ExponentialAverage[pds](x)
     hiAvg=Highest[pdsback](high)
     loAvg=Lowest[pdsback](low)
     ////////////////////////////////////////////////////////////////////////////////////
     if hiavg >=avg then
      
      shift= exponentialaverage[pds](hiavg -avg)
     else
      
      shift=exponentialaverage[pds](avg-loavg)
      
     endif
     
     
     ////////////////////////////////////////////////////////////////////////////
     UpperBand=Avg+shift
     LowerBand=Avg-shift
     
     
     /////////////////////////////////////////////////////////////
     
     
     return avg as "exponentielle",upperband as "bande haute",lowerband as" bande basse"

 

////////////////////////////////////////////fin///end ///code

 

CAC-40-elderenveloppe-copie-1.png
     
     
     

 

Partager cet article
Repost0
Published by SOHOCOOL - dans ELDER
17 février 2011 4 17 /02 /février /2011 19:57

 Bonsoir à tous,

 

Code Elder Impulse Dema :il suffit de remplacer les moyennes exponentielles,par

 

des moyennes Dema (exponentielle zero lag).

 

Dema = double exponential moving average.

 

Remarque ; je garde la moyenne exponentielle pour le signal du Macd.

 

Vous pouvez facilement ,changer dans le code , Dema par Tema (la Triple exponential

moving average).

 

 

 

ERREUR CORRIGEE LE17/02 A 21H 10

   

CODE PROREALTIME:

 

////////////////////ELDER IMPULSE DEMA////
///////By Sohocool pour Prorealtime
///////////LE 17 /  02 /2011

 

{ variables
Macd :      pc= moyenne courte  -- 12
pl=moyenne longue         -- 26
ps = moyenne du signal  -- 9

Moyenne Dema  p= période   -- 13

METTRE TOUT EN HISTOGRAMME

}


aa=dema[p](close)


gg=  dema[pc](close) - dema[pl](close)       

      

cc=gg - exponentialaverage[ps](gg)

 

if aa > aa[1]  and cc>CC[1] Then
 dd =1
else
 dd=0
endif

if aa<aa[1] and cc < cc[1] then
 ee=1
else
 ee=0
endif

if ( aa <aa[1] and cc > cc[1]) or (aa>aa[1] and cc<cc[1])  then
 ff=1
else
 ff=0
endif


return dd COLOURED(0,255,0) as "elder impulse dema",ee COLOURED(255,0,0) as "elder impulse dema",ff coloured(0,0,255) as "elder impulse dema"

/////Fin du code////////

 

  CAC-40-impuldema.png

 

Gold-IMPULSEDEMA.png

 

 

 

 

 

Partager cet article
Repost0
Published by SOHOCOOL - dans ELDER
13 juillet 2010 2 13 /07 /juillet /2010 19:22

Bonsoir,

 

Je vous propose de mettre l'elder impulse sur le graphique prix.

 

Il faut mieux regarder le prix (price action) ,qu'un indicateur.

 

Quand l'Elder impulse est vert ,le prix est au dessus de la ligne verte.

  

Quand l'Elder impulse est rouge ,le prix est en dessous de la ligne rouge.

 

Quand l'Elder impulse est bleu ,le prix est sur de la ligne (medianprice) .

 

Ce code est pour Prorealtime:

 

 

 

////////////////////ELDER IMPULSE ON CHART////
///////By Sohocool pour Prorealtime

{ variables
Macd :      pc= moyenne courte  -- 12
pl=moyenne longue         -- 26
ps = moyenne du signal  -- 9

Moyenne exponentielle  p= période   -- 13

 


}


aa=exponentialaverage[p](close)


cc=MACD[pc,pl,ps](close)


if aa > aa[1]  and cc>CC[1] Then
 dd =1
else
 dd=0
endif

if aa<aa[1] and cc < cc[1] then
 ee=1
else
 ee=0

endif

//if ( aa <aa[1] and cc > cc[1]) or (aa>aa[1] and cc<cc[1])  then
// ff=1
//else
// ff=0
//endif

if dd=1 then
 imp=low*0.98
ELSIF ee=1 then
 
 imp=high*1.02
else
 imp=medianprice
endif

 

 

return imp as "Elder impulse on chart"

/////Fin du code////////

  

  Ps : on peut faire la même chose avec le Grey zone de Bill Williams ,etc......

 

 

CAC-40elder-on-chart.png

Partager cet article
Repost0
Published by SOHOCOOL - dans ELDER
9 octobre 2009 5 09 /10 /octobre /2009 18:42

Macd Impulse Elder : l'histogramme du Macd ,est coloré par l 'Impulse Elder.

Code vu sur le site Metatrader (lien ci-dessous):

http://codebase.mql4.com/ru/6048

http://translate.google.fr/translate?u=http%3A%2F%2Fcodebase.mql4.com%2Fru%2F6048&sl=ru&tl=fr&hl=fr&ie=UTF-8


Code Prorealtime:

/////////////////MACD  IMPULSE ELDER////
///////By Sohocool -- Prorealtime

{ variables
Macd :      pc= moyenne courte  -- 12
pl=moyenne longue         -- 26
ps = moyenne du signal  -- 9

Moyenne exponentielle  p= période   -- 13

METTRE 3 PREMIERS EN HISTOGRAMME

}


aa=exponentialaverage[p](close)


cc=MACD[pc,pl,ps](close)


if aa > aa[1]  and cc>CC[1] Then
 dd =CC*3
else
 dd=0
endif

if aa<aa[1] and cc < cc[1] then
 ee=CC*3
else
 ee=0
endif

if ( aa <aa[1] and cc > cc[1]) or (aa>aa[1] and cc<cc[1])  then
 ff=CC*3
else
 ff=0
endif
////////////////////////////////////////////////////////////

hh=exponentialaverage[pc](close) - exponentialaverage[pl](close)
hh1=exponentialaverage[ps](hh)
/////////////////////////////////////////////////////////////////////////////////////////////

return dd COLOURED(0,255,0) as "elder impulse",ee COLOURED(255,0,0) as "elder impulse",ff coloured(0,0,255) as "elder impulse",hh as " macd",hh1 as " signal macd"

/////Fin du code////////




Partager cet article
Repost0
Published by SOHOCOOL - dans ELDER
3 octobre 2009 6 03 /10 /octobre /2009 18:32

L 'indicateur  Impulse system du docteur Alexander Elder  .

Explications (Anglais) :

http://www.forexproject.com/tag/alexander-elder/

Code Metatrader :


http://codebase.mql4.com/4341


Code Prorealtime :


////////////////////ELDER IMPULSE SYSTEM////
///////By Sohocool pour Prorealtime

/// variables
///Macd :      pc= moyenne courte  -- 12
///pl=moyenne longue         -- 26
///ps = moyenne du signal  -- 9

///Moyenne exponentielle  p= période   -- 13

///METTRE TOUT EN HISTOGRAMME

 


aa=exponentialaverage[p](close)


cc=MACD[pc,pl,ps](close)


if aa > aa[1]  and cc>CC[1] Then
 dd =1
else
 dd=0
endif

if aa<aa[1] and cc < cc[1] then
 ee=1
else
 ee=0
endif

if ( aa <aa[1] and cc > cc[1]) or (aa>aa[1] and cc<cc[1])  then
 ff=1
else
 ff=0
endif


return dd COLOURED(0,255,0) as "elder impulse",ee COLOURED(255,0,0) as "elder impulse",ff coloured(0,0,255) as "elder impulse"

/////Fin du code////////




 

 

 

 

Partager cet article
Repost0
Published by SOHOCOOL - dans ELDER