Overblog
Editer l'article Suivre ce blog Administration + Créer mon blog
23 avril 2011 6 23 /04 /avril /2011 15:25

Bonjour à tous,

 

Bonjour Fred,

 

Le code Bandes de Bollinger multiples moyennes mobiles stop and reverse pour PRT

 

Ci dessous le lien pour indicateur MT4 :

 

http://forex-indicators.net/mt4-indicators/bbands_stop

 

Ici l'histogramme :

 

http://www.forex-tsd.com/indicators-metatrader-4/10228-bbands-stop-bar-2.html#post277800

 

On peut régler le style de l indicateur ligne façon Supertend ou Points façon S.A.R.

 

 

CODE PRT :

 

//////////////////////////////////////////////////////////////////////////////////////

///BBolliinger_stop_and_reverse
///By Sohocool.
///super bandes Bollinger Stop and reverse

///Variables    P =periode moyenne mobile par défaut ==22
///////////////////////s = type de la moyenne mobile par défaut =Simple
///////////////////////r = Coefficiaent ecart type (standard deviation) par défaut = 1.00 // mettre décimale
//////////////Réglage de la courbe ligne =façon Super trend ou Points façon SAR.


////////////Bands_bollinger
// ecart type = standard deviation
co=customclose
av=average[p,s](co)
som=0
for i=0 to p-1 do
 som = som + SQUARE( co[i]-av)
next
som=som / p
ecart = SQRT(som)

//cv = average[p,s](co)

up= av + r*ecart
dn= av - r*ecart

 


///////////////////Stop and reverse
once trend=1
if co>up[1] then
 trend=1
elsif co<dn[1] then
 trend=-1
endif
if trend<0 and trend[1]>0 then
 flag=1
else
 flag=0
endif
if trend>0 and trend[1]<0 then
 flagh=1
else
 flagh=0
endif
if trend>0 and dn<dn[1] then
 dn=dn[1]
endif
if trend<0 and up>up[1] then
 up=up[1]
endif
if flag=1 then
 up=av+r*ecart
endif
if flagh=1 then
 dn=av-r*ecart
endif
if trend=1 then
 super=dn
else
 super=up
endif
return super coloured by trend as "BBollinger_Stop_Reverse"

/////////////////////////////////Fin////End

 

 

 

CAC-40-bb_stop.png

USD-bbstop.png

Partager cet article
Repost0
Published by SOHOCOOL - dans Bollinger John