Overblog
Editer l'article Suivre ce blog Administration + Créer mon blog
12 avril 2008 6 12 /04 /avril /2008 19:32

Fractal - Alligator by Bill Williams.

Voici un programme qui retourne les indicateurs de Bill Williams : Fractal et Alligator.  Un système de trading complet a été mis au point par l'auteur, je n'ai pas trouvé d'avis tranchants sur ses résultats.  Une vue de AAPL avec l'indicateur :



Et le code pour Prorealtime :

de48=DPO[20](close)
if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] then
    flag=barindex+8
    flag1=1
endif

mp=MedianPrice
blue=WilderAverage[13](mp)
red=WilderAverage[8](mp)
green=WilderAverage[5](mp)
k=10
n=(k*2)-4
p=(n/2)-1
h1=DPO[n](high)
moyh=high-h1
hi=(moyh-moyh[1]+(high[p])/n)*n
hi=(round(hi*100))/100
l1=dpo[n](low)
moyl=low-l1
lo=(moyl-moyl[1]+(low[p])/n)*n
lo=(round(lo*100))/100
if low[1]>low and low[2]>low and lo[7]>low and lo[8]>low and (barindex<flag or flag1=0) then
    frac=low-(AverageTrueRange[14](close))*.5
else
    frac=blue[8]
endif
if high>high[1] and high>high[2] and high>hi[8] and high>hi[7] and (barindex<flag or flag1=0) then
    frac1=high+(averagetruerange[14](close))*.5
else
    frac1=blue[8]
endif
return red[5],green[3],frac, frac1,blue[8]

Edit le 03/07/08 : le code est changé pour tenir compte d'un possible affichage intempestif de l'indicateur sur les 2 dernières barres.
Partager cet article
Repost0

commentaires