Mardi 9 décembre 2008
2
09
/12
/Déc
/2008
16:27
Boîtes de Darvas et Stratégies.
La stratégie employée par Darvas est une technique de breakout : achat lorsque le haut de la boîte est cassé, à cela on peut encore ajouter des filtres. J'ai testé le système sur
les actions US, celui-ci fonctionne mieux sur celles du Nasdaq que sur celles composant le Dow Jones (question de volatilité, valeur de croissance.....). La majeure partie des gains
s'effectue lors de la période 1999/2000 pour la plupart des valeurs. Pour une première approche, il n'y a pas de slippage, ni de frais. Le capital est de 20000, la portion investie de
10000, il n'y a pas de pyramidage.
Il y a comparaison entre les systèmes "bearish" et "bullish", ainsi qu'une variation de la validation de la cassure : par la cloture ou simplement par le high. La condition de sortie du trade
est une cassure par le bas d'une boîte.
Voici une vue de VRSN avec les EC's des différents systèmes :
Une autre vue avec OXY :
Le système 1 est le "bearish" + cloture.
Le système 2 est le "bearish" + high/low.
Le système 3 est le "bullish" + cloture.
Le système 4 est le "bullish" + high/low.
D'une façon générale, le système "bearish" est plus performant. C'est curieux, j'aurais parié le contraire. Je n'en ai pas analysé la raison, peut-être les sorties. Sinon, pas de
grosses différences entre les systèmes "cloture" et "high/low". Suivant le support, c'est tantôt l'un, tantôt l'autre.
Voici les codes pour Prorealtime :
//////////////// système 1 /////////////////
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[3] and low[1]>low[3] and low[2]>low[3] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[3] and high[1]<high[3] and high[2]<high[3] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
if close>tth then
buy 50 %CAPITAL at market thisbaronclose
endif
if close<ttl then
sell at market thisbaronclose
endif
//////////////////// système 2 ////////////////
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[3] and low[1]>low[3] and low[2]>low[3] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[3] and high[1]<high[3] and high[2]<high[3] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
buy 50 %capital at tth stop
sell at ttl stop
////////////////// système 3 ///////////////////
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and high<high[3] and high[1]<high[3] and high[2]<high[3] then
th=high[3]
flag=1
endif
if flag=1 and box=0 and high>th then
flag=0
endif
if flag=1 and box=0 and low>low[3] and low[1]>low[3] and low[2]>low[3] then
ttl=low[3]
tth=th
box=1
endif
once tth=undefined
once ttl=undefined
if close>tth then
buy 50 %CAPITAL at market thisbaronclose
endif
if close<ttl then
sell at market thisbaronclose
endif
////////////////// système 4 ///////////////////
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and high<high[3] and high[1]<high[3] and high[2]<high[3] then
th=high[3]
flag=1
endif
if flag=1 and box=0 and high>th then
flag=0
endif
if flag=1 and box=0 and low>low[3] and low[1]>low[3] and low[2]>low[3] then
ttl=low[3]
tth=th
box=1
endif
once tth=undefined
once ttl=undefined
buy 50 %CAPITAL at tth stop
sell at ttl stop
Remarque : si vous voulez afficher pour contrôle, l'indicateur utilisé, il faut ajouter "return tth, ttl" à la place des instructions d'achat/vente.