Le Box Range Breakout, une technique de trading simple
Un focus sur une technique assez répandue, qui peut donner des résultats intéressants.
Cette technique est relativement simple dans sa réalisation. On définit une tranche horaire, par exemple 0h-9h. On prend le plus haut de ces 10 bougies et le plus bas (zone rouge), et à partir de 10h00, dès que l’on casse un de ces 2 niveaux (lignes jaunes), on prend position dans le sens de la cassure:
Une technique très simple à mettre en place qui permet d’exploiter par exemple les zones très peu volatiles et des plages horaires “entre deux continents” et jouer ensuite, la reprise du trend. Vous pouvez télécharger ici le robot de trading basic en mq4 pour metatrader, si vous voulez vous y essayer. Vous pouvez bien sûr grandement l’améliorer et vous en inspirer pour apprendre à coder.
On peut trouver de belles performances avec un peu de travail (en fonction des paires, des tranches horaires, des stoploss et des takeprofit):
Si vous avez apprécié cet article, s'il vous plait, prenez le temps de laisser un commentaire ou de souscrire au flux afin de recevoir les futurs articles directement dans votre lecteur de flux.
Commentaires
il faut savoir qu’une optimisation quelqu’elle soit demande souvent plus de 280 heures de calcul.
donc teste les en automatique. je ne peux effectuer les tests pour tout le monde.
bonjour,
ca sert pour que l’EA puisse retrouver ses propres ordres. Par exemple, il évite de fermer ceux que tu as passés manuellement
Chris,
Voici un petit programme vu sur le site de Gerard Lefeuvre..
,codé en MT4….!!!!
As tu le temps de le transcrire sur Prt…??
Ou bien ouvrir un sujet “o-boo” sur ce programme..
Cela intéresserait tes lecteurs..non ??
Je sais que ton temps est compté..
a+
//+——————————————————————+
//| CycleIdentifier.mq4 |
//| |
//+——————————————————————+
#property copyright “”
#property link “”
//—-
#property indicator_separate_window
#property indicator_buffers 6
//—-
#property indicator_color1 DarkGray
#property indicator_color2 Lime
#property indicator_color3 Red
#property indicator_color4 DarkGreen
#property indicator_color5 Brown
//—-
#property indicator_minimum -1.2
#property indicator_maximum 1.2
//—-
extern int PriceActionFilter=1;
extern int Length=3;
extern int MajorCycleStrength=4;
extern bool UseCycleFilter=false;
extern int UseFilterSMAorRSI=1;
extern int FilterStrengthSMA=12;
extern int FilterStrengthRSI=21;
//—-
double LineBuffer[];
double MajorCycleBuy[];
double MajorCycleSell[];
double MinorCycleBuy[];
double MinorCycleSell[];
double ZL1[];
//—-
double CyclePrice=0.0, Strength =0.0, SweepA=0.0, SweepB=0.0;
int Switch=0, Switch2=0, SwitchA=0, SwitchB=0, SwitchC=0, SwitchD=0, SwitchE=0, SwitchAA=0, SwitchBB=0;
double Price1BuyA=0.0, Price2BuyA=0.0;
int Price1BuyB=1.0, Price2BuyB=1.0;
double Price1SellA=0.0, Price2SellA=0.0;
int Price1SellB=0.0, Price2SellB=0.0;
bool ActiveSwitch=True, BuySwitchA=FALSE, BuySwitchB=FALSE, SellSwitchA=FALSE, SellSwitchB=FALSE;
int BuySellFac=01;
bool Condition1, Condition2, Condition3, Condition6;
//+——————————————————————+
//| |
//+——————————————————————+
int init()
{
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
SetIndexBuffer(0,LineBuffer);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexBuffer(1,MajorCycleBuy);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexBuffer(2,MajorCycleSell);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(3,MinorCycleBuy);
SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(4,MinorCycleSell);
SetIndexStyle(5,DRAW_NONE);
SetIndexBuffer(5,ZL1);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
SetIndexEmptyValue(3,0.0);
SetIndexEmptyValue(4,0.0);
SetIndexEmptyValue(5,0.0);
return(0);
}
//+——————————————————————+
//| |
//+——————————————————————+
int deinit() {return(0);}
//+——————————————————————+
//| |
//+——————————————————————+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars0) counted_bars–;
// int position=Bars-1;
int position=Bars-counted_bars;
if (position=0; pos–)
{
srange=0.0;
int j=0;
for(int i=0;i=Bars)
break;
srange=srange + (High[posr] - Low[posr]);
}
range=srange/j * Length;
int BarNumber=Bars-pos; //??????????
if (BarNumber ZL1[pos+1])
SwitchC=1;
if (ZL1[pos] < ZL1[pos+1])
SwitchC=2;
if (BarNumber 1)
{
if (Switch > -1)
{
if (CyclePrice Price1BuyA)
{
SwitchA=BarNumber - Price1BuyB;
if (!UseCycleFilter)
{
MinorCycleBuy[pos +SwitchA]=-1;//MinorBuySell - DarkGreen
LineBuffer[pos +SwitchA]=-1;//line
}
if (UseCycleFilter && SwitchC ==1)
{
MinorCycleBuy[pos +SwitchA]=-1; //MinorBuySell
LineBuffer[pos +SwitchA]=-1; //line
SwitchD=1;
}
else
{
SwitchD=0;
}
BuySwitchA=TRUE;
double cyclePrice1=iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchA);
if (ActiveSwitch)
{
Condition1=CyclePrice - cyclePrice1>=SweepA;
}
else
{
Condition1=CyclePrice>=cyclePrice1 * (1 + SweepA/1000);
}
if (Condition1 && SwitchA>=BuySellFac)
{
Switch= - 1;
Price1SellA=CyclePrice;
Price1SellB=BarNumber;
SellSwitchA=FALSE;
BuySwitchA=FALSE;
}
}
}
if(Switch Price1SellA)
{
if (UseCycleFilter && SwitchC==1 && SellSwitchA )
{
MinorCycleSell[pos +BarNumber - Price1SellB]=0; //MinorBuySell
LineBuffer[pos +BarNumber - Price1SellB ]=0; //line
}
if (!UseCycleFilter && SellSwitchA )
{
MinorCycleSell[pos +BarNumber - Price1SellB]=0;//MinorBuySell
LineBuffer[pos +BarNumber - Price1SellB]=0;//line
}
Price1SellA=CyclePrice;
Price1SellB=BarNumber;
SellSwitchA=TRUE;
}
else if (CyclePrice =SweepA;
else
Condition1=CyclePrice=BuySellFac)
{
Switch=1;
Price1BuyA=CyclePrice;
Price1BuyB=BarNumber;
SellSwitchA=FALSE;
BuySwitchA=FALSE;
}
}
}
}
LineBuffer[pos]=0;
MinorCycleBuy[pos]=0;
MinorCycleSell[pos]=0;
//—-
if (BarNumber==1)
{
if (Strength==0)
SweepB =range * MajorCycleStrength;
else
SweepB=Strength * MajorCycleStrength;
Price2BuyA=CyclePrice;
Price2SellA=CyclePrice;
}
if (BarNumber > 1)
{
if (Switch2 > - 1)
{
if (CyclePrice Price2BuyA)
{
SwitchB=BarNumber - Price2BuyB;
if (!UseCycleFilter)
{
MajorCycleBuy [pos +SwitchB]=-1; //MajorBuySell green
// LineBuffer[pos + SwitchB] = -1; //line————–
}
if (UseCycleFilter && SwitchC ==1)
{
MajorCycleBuy [pos +SwitchB]=-1; //MajorBuySell green
// LineBuffer[pos + SwitchB] = -1; //line—————–
SwitchE =1;
}
else
SwitchE =0;
BuySwitchB=TRUE;
double cyclePrice3=iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchB);
if (ActiveSwitch)
Condition6=CyclePrice - cyclePrice3>=SweepB;
else
Condition6=CyclePrice>=cyclePrice3 * (1 + SweepB/1000);
if (Condition6 && SwitchB>=BuySellFac)
{
Switch2= - 1;
Price2SellA=CyclePrice;
Price2SellB=BarNumber;
SellSwitchB=FALSE;
BuySwitchB=FALSE;
}
}
}
if (Switch2 Price2SellA )
{
if (UseCycleFilter && SwitchC ==1 && SellSwitchB )
{
MajorCycleSell [pos +BarNumber - Price2SellB]=0; //”MajorBuySell”,red
// LineBuffer[pos + BarNumber - Price2SellB ] = 0; //line —–
}
if (!UseCycleFilter && SellSwitchB )
{
MajorCycleSell [pos +BarNumber - Price2SellB]=0;//”MajorBuySell”,red
// LineBuffer[pos + BarNumber - Price2SellB ] = 0; //line —–
}
Price2SellA=CyclePrice;
Price2SellB=BarNumber;
SellSwitchB=TRUE;
}
else if (CyclePrice =SweepB;
else
Condition6=CyclePrice=BuySellFac)
{
Switch2=1;
Price2BuyA=CyclePrice;
Price2BuyB=BarNumber;
SellSwitchB=FALSE;
BuySwitchB=FALSE;
}
}
}
}
LineBuffer[pos]=0;
MajorCycleSell[pos]=0;
MajorCycleBuy[pos]=0;
}
return(0);
}
//+——————————————————————+
//| |
//+——————————————————————+
double ZeroLag(double price, int length, int pos)
{
if (length < 3)
{
return(price);
}
double aa=MathExp(-1.414*3.14159/length);
double bb=2*aa*MathCos(1.414*180/length);
double CB=bb;
double CC=-aa*aa;
double CA=1 - CB - CC;
double CD=CA*price + CB*ZL1[pos+1] + CC*ZL1[pos+2];
return(CD);
}
//+——————————————————————+
le cycle identifier a l’air intéressant, mais es tu sûr que ce n’est pas encore un énième indicateur qui repeint le passé et qui donc ne sert a rien?
Attention, cycle identifier repeint, il ne fait juste qu’indiquer des potentiels creux ou sommets, tout ceci est visible à l’oeil nu.
bonjour Chris,
j’ai voulu utiliser cet EA et il ne prend pas de position.
j’ai dû rater quelque chose ,il fonctionne sur toutes les unités de temps ? ,j’ai utilisé une unité Hourly et rien se passe.
si tu pouvais m’éclairer et encore un grand bravo pour ton site.
Bonjour,
Est ce que tu pourrai mettre un system de breakeven pour éviter quelques pertes voir mème un trailling stop.
Merci
Bon il y a un problème dans ton code.
Voila j’ai fait un réglage pour du 2h 7h mais comme tu peux le voir il déclenche un short alors que nous n’avons pas atteint le plus bas compris entre 2h et 7h du matin.
Il y a donc un prob dans la manière de récupérer le plus bas et le plus haut pendant cette période.
Pourrais tu voir à régler ce problème svp merci
oups voici le lien pour voir le screen en exemple.
http://img7.hostingpics.net/pics/660736ScreenHunter_01_Nov._14_17.17.png
bonjour,
je suis en train de découvrir un peu le monde du trader et j’ai un compte chez btrader sur la MT4
par contre je voulais essayer vos robots, mais je déséspére car je n’arrive pas a les insérer sur la plate forme.
pouvez vous m’indiquer la marche a suivre?
merci beaucoup pour le coupde main
et nickel vos articles ça aide beaucoup quand on debute







Bonjour Chris,
Te serait-il possible de bien vouloir préciser sur quelle paire de devises et éventuellement avec quels paramétrages (SL, TP…), tu as pu obtenir cette performance ?
J’ai en fait backtesté manuellement quelques stratégies de breakout sur différentes paires mais elles ne me sont jamais apparues comme étant concluantes (mais le novice que je suis a pu très facilement se tromper
!)…
Merci d’avance pour ta réponse et pour ton blog que je découvre avec plaisir
!
Fxseb