English Русский 中文 Español Deutsch 日本語 Português 한국어 Italiano Türkçe
Analyser  les modèles de chandeliers

Analyser les modèles de chandeliers

MetaTrader 5Systèmes de trading | 17 novembre 2021, 15:26
802 0
Dmitry Voronkov
Dmitry Voronkov


"En se renseignant sur l'ancien, nous apprenons le nouveau"

Introduction

Le tracé de graphiques en chandeliers et l'analyse des modèles de chandeliers constituent une ligne d'analyse technique passionnante. L'avantage des chandeliers est qu'ils représentent les données de sorte qu'il soit possible de voir l'élan dans les données.

Les chandeliers donnent une image mentale intense du trading. Après lecture et un peu de pratique, les chandeliers feront partie de votre arsenal analytique. Les graphiques en chandeliers japonais peuvent vous aider à pénétrer « à l'intérieur » des marchés financiers, ce qui est très difficile à faire avec d'autres méthodes graphiques. Ils sont également adaptés à tous les marchés.

1. Types de chandeliers

L'un des premiers analystes qui ont commencé à anticiper le mouvement des prix à l'avenir, sur la base des prix passés, était le légendaire japonais Munehisa Homma Les principes commerciaux appliqués par Homma dans le trading sur le marché du riz, ont initié la technique des chandeliers japonais, qui est maintenant largement utilisée au Japon et à l'étranger.

Structure d'un chandelier

Figure 1. Structure d'un chandelier

Considérez la structure d'un chandelier (Fig. 1). Le rectangle représentant la différence entre les prix d'ouverture et de clôture, est appelé le corps du chandelier. La hauteur du corps représente la fourchette entre les prix d'ouverture et de clôture de la période de trading. Lorsque le prix de clôture est supérieur au prix d'ouverture, le corps du chandelier est blanc (Fig. 1 a). Si le corps est noir (Fig. 1 b), cela signifie que le prix de clôture était inférieur au prix d'ouverture.

Les chandeliers peuvent avoir des ombres - le haut et le bas, la longueur des ombres dépend de la distance entre les prix d'ouverture/de clôture et les prix minimum/maximum.

Les chandeliers sont tracés sur le graphique un par un, formant divers motifs. Selon la théorie, certains modèles peuvent indiquer avec une certaine probabilité que la tendance est en train de changer, ou confirmer la tendance, ou montrer que le marché est indécis.

En règle générale, les longs corps de chandeliers indiquent la pression des acheteurs ou des vendeurs (selon la couleur du chandelier). Les corps courts signifient que la lutte entre les taureaux et les ours était faible.

 Chandeliers Description
 

"longs Chandeliers ". Le lien avec les longs chandeliers est très répandu dans la littérature sur les chandeliers japonais.
Le terme "long" fait référence à la longueur du corps d'un chandelier, la différence entre le prix d'ouverture et le prix de clôture.
Il est préférable de considérer les mouvements de prix les plus récents pour déterminer ce qui est long et ce qui ne l'est pas.
Cinq ou dix jours précédents - c'est une période tout à fait suffisante pour aboutir à une conclusion correcte.
 

 "Courts Chandeliers". La détermination des chandeliers courts peut être basée sur la même méthodologie que dans le cas des chandeliers longs, avec des résultats similaires.
De plus, il existe de nombreux chandeliers, qui n'entrent dans aucune de ces deux catégories.
"Marubozu" . En japonais, "Marubozu" signifie presque audacieux.
Dans tous les cas, le sens du terme reflète le fait que le corps du chandelier soit n'a pas du tout d'ombres vers le haut et/ou vers le bas, soit qu'elles sont très petites.

Marubozu noir - un long corps noir sans ombre sur l'un des côtés. Cela devient souvent une partie de la configuration de continuation baissière ou de la configuration de renversement haussier, apparaissant en particulier dans une tendance baissière. Un long chandelier noir indique une victoire majeure des ours, il apparaît donc souvent le premier jour de nombreux modèles d'inversion du caractère haussier.

Marubozu blanc - un long corps blanc sans ombre sur l'un des côtés. C'est une bougie très puissante. Contrairement au marubozu noir, il s'avère souvent faire partie d'un modèle de continuation haussier ou d'un modèle de retournement baissier.
"Doji". Si le corps du chandelier est si petit que les prix d'ouverture et de clôture sont identiques, on l'appelle Doji.
L'exigence selon laquelle les prix d'ouverture et de clôture doivent exactement être égaux impose des restrictions strictes sur les données, et Doji apparaît très rarement.
Si la différence de prix entre les prix d'ouverture et de clôture ne dépasse pas quelques ticks (changement minimum de prix), c'est plus que suffisant.
Les "Toupies Tournantes" sont des chandeliers courts avec une ombre supérieure et/ou inférieure plus longue que le corps.
Parfois, ils sont appelés Doji "blancs" et "noirs". Koma indique l'indécision des taureaux et des ours.
La couleur du corps de Koma, ainsi que la longueur de son ombre, n'ont pas d'importance. Le petit corps par rapport aux ombres est ce qui fait la toupie.
 

"L’Homme Pendu" et "Le Marteau". Ce sont des chandeliers avec de longues ombres inférieures et des corps courts. Les carrosseries sont dans le haut de gamme des prix.
La propriété surprenante de ces chandeliers est qu'ils peuvent être haussiers et baissiers, selon la phase des tendances dans laquelle ils apparaissent.
L'apparition de ces bougies dans une tendance baissière est un signal que sa domination sur le marché touche à sa fin, dans ce cas le chandelier est appelé "le marteau".
Si le chandelier apparaît pendant une tendance haussière, cela indique sa fin probable et le chandelier a un nom alarmant - "homme pendu".
"Un début" apparaît chaque fois que le petit corps apparaît. Chaque fois qu'un petit corps s'ouvre vers le haut ou vers le bas par rapport au corps long précédent, la couleur du corps n'a pas d'importance.
Idéalement, l'écart doit aussi capter les ombres, mais ce n'est pas tout à fait nécessaire. L'étoile indique une certaine incertitude régnant sur le marché.
Les étoiles sont comprises dans de nombreux modèles de chandeliers, principalement des inversions.

Tableau 1. Types de chandeliers

Des chandeliers séparés sont extrêmement importants pour l'analyse des combinaisons de chandeliers. Lorsqu'un analyste les utilise séparément, puis en combinaison avec d'autres chandeliers, l'état psychologique du marché est révélé.

2. Identification des types de base de chandeliers

2.1. Structures nécessaires

Les modèles de chandelier peuvent être un chandelier séparé ou se composer de quelques-uns d'entre eux. Pour les modèles de chandeliers, il existe certaines règles d’identification.

Exemple : Étoile du soir (motif baissier). La tendance à la hausse. Les premier et troisième chandeliers sont "longs". Les ombres des étoiles sont courtes, la couleur ne compte pas. Le schéma classique : séparation de l'étoile de la clôture du premier chandelier, pour le forex et dans la journée : La clôture du premier chandelier et l'ouverture de l'étoile sont égales. Le troisième chandelier est clôturé à l'intérieur du corps du premier.

Apprenons donc d'abord à identifier les types de chandeliers. Pour cela, nous écrivons une fonction RecognizeCandle, qui identifiera le type de chandeliers et remettra les informations nécessaires.

//+------------------------------------------------------------------+
//|   Function of candlestick type recognition                       |
//+------------------------------------------------------------------+
bool RecognizeCandle(string symbol,ENUM_TIMEFRAMES period, datetime time,int aver_period,CANDLE_STRUCTURE &res)
Où:
  • symbole - le nom du symbole
  • période – période du graphique,
  • temps – temps d'ouverture du chandelier,
  • aver_period - période de péréquation
  • res - une structure, dans laquelle le résultat est renvoyé.

Définissons les résultats dont nous avons besoin, sur la base des règles d’identification des modèles de chandeliers :

  • ouvrir, clôturer, haut et bas;
  • temps d'ouverture du chandelier;
  • direction de la tendance ;
  • chandelier haussier ou baissier ;
  • taille du corps du chandelier – une valeur absolue ;
  • type de chandelier (d'après le tableau 1).

Créons une structure :

//+------------------------------------------------------------------+
//| Structure CANDLE_STRUCTURE                                       |
//+------------------------------------------------------------------+
struct CANDLE_STRUCTURE
  {
   double            open,high,low,close; // OHLC
   datetime          time;     //Time
   TYPE_TREND       trend;    //Trend
   bool              bull;     //Bull candlestick
   double            bodysize; //Body size
   TYPE_CANDLESTICK  type;    //Type of candlestick
  };

où tendance et type sont des variables de type énumération :

//+------------------------------------------------------------------+
//|   ENUM TYPE CANDLESTICK                                          |
//+------------------------------------------------------------------+
enum TYPE_CANDLESTICK
  {
   CAND_NONE,          //Unrecognized
   CAND_MARIBOZU,       //Marubozu
   CAND_MARIBOZU_LONG, //Marubozu long
   CAND_DOJI,           //Doji
   CAND_SPIN_TOP,       //Spinning Tops
   CAND_HAMMER,         //Hammer
   CAND_INVERT_HAMMER, //Reverse hammer
   CAND_LONG,           //Long
   CAND_SHORT,          //Short
   CAND_STAR            //Star
  };
//+------------------------------------------------------------------+
//|   TYPE_TREND                                                     |
//+------------------------------------------------------------------+
enum TYPE_TREND
  {
   UPPER,   //Upward
   DOWN,    //Downward
   LATERAL  //Lateral
  }; 

Considérons la fonction RecognizeCandle.

2.2. Identification du type chandelier

//+------------------------------------------------------------------+
//| Function of recognition of candlestick type                      |
//+------------------------------------------------------------------+
bool RecognizeCandle(string symbol,ENUM_TIMEFRAMES period, datetime time,int aver_period,CANDLE_STRUCTURE &res)
  {
   MqlRates rt[];
//--- Get data of previous candlesticks
   if(CopyRates(symbol,period,time,aver_period+1,rt)<aver_period)
     {
      return(false);
     }

Tout d'abord, en utilisant la fonction CopyRates, obtenez les données des chandeliers aver_period +1 précédents. Notez l'ordre dans lequel les données sont stockées dans le tableau que nous obtenons.

Si les données ont été reçues sans erreur, commencez à remplir notre structure de retour CANDLE_STRUCTURE avec des données.

   res.open=rt[aver_period].open;
   res.high=rt[aver_period].high;
   res.low=rt[aver_period].low;
   res.close=rt[aver_period].close;
   res.time=rt[aver_period].time;

Définir la tendance. Qu'est-ce qu'une tendance ? Si cette question avait eu une réponse assez complète, les secrets du marché auraient été dévoilés. Dans cet article, nous utiliserons la méthode pour déterminer la tendance à l'aide d'une moyenne variable.

MA=(C1+C2+…+Cn)/N,
où C – prix de clôture, N – nombre de barres.

L. Morris dans son livre "Candlestick Charticng Explained. Techniques intemporelles pour le Trading d'Actions et de Contrats à Terme" utilise une moyenne variable avec une période de dix pour identifier une tendance à court terme ; si le prix de clôture est supérieur à la moyenne - la tendance est à la hausse, si elle est inférieure - elle est à la baisse.

Voilà à quoi ça ressemble :

//--- Define the trend direction
   double aver=0;
   for(int i=0;i<aver_period;i++)
   {
      aver+=rt[i].close;
   }
   aver=aver/aver_period;
   
   if(aver<res.close) res.trend=UPPER;
   if(aver>res.close) res.trend=DOWN;
   if(aver==res.close) res.trend=LATERAL;

Ensuite, nous définissons si notre bougie est haussière ou baissière, nous calculons la valeur absolue du corps du chandelier, la taille des ombres, la taille moyenne du corps du chandelier pendant aver_period et d'autres données intermédiaires nécessaires.

//--- Define of it bullish or bearish
   res.bull=res.open<res.close;
//--- Get the absolute value of the candlestick body size
   res.bodysize=MathAbs(res.open-res.close);
//--- Get the size of shadows
   double shade_low=res.close-res.low;
   double shade_high=res.high-res.open;
   if(res.bull)
     {
      shade_low=res.open-res.low;
      shade_high=res.high-res.close;
     }
   double HL=res.high-res.low;
//--- Calculate the average body size of previous candlesticks
   double sum=0;
   for(int i=1; i<=aver_period; i++)
      sum=sum+MathAbs(rt[i].open-rt[i].close);
   sum=sum/aver_period;

Intéressons-nous maintenant à l'identification des types de chandeliers.

2.3. Règles d'identification des types de chandeliers

"Longs"chandeliers Pour définir des chandeliers "longs", vérifiez la valeur du présent chandelier par rapport à la valeur moyenne des bougies précédentes aver_period.

(Corps) > (corps moyen des cinq derniers jours) *1.3

//--- long 
   if(res.bodysize>sum*1.3) res.type=CAND_LONG;

"courts"chandeliers. Pour définir des chandeliers "courts", utilisez le même principe que pour les "longs", mais avec une condition modifiée.

(Corps) > (corps moyen des X derniers jours) *0,5

//--- short 
   if(res.bodysize<sum*0.5) res.type=CAND_SHORT;

Doji. Doji se produit lorsque les prix d'ouverture et de clôture sont égaux. C'est une règle très stricte. Dans le cas de la plupart des types de données, nous pouvons tolérer certains écarts dans la recherche de modèles. La formule permet de trouver la différence en pourcentage entre les deux prix à des seuils acceptables.

(corps Dodji) < (gamme du prix le plus élevé au plus bas) * 0,03

//--- doji
   if(res.bodysize<HL*0.03) res.type=CAND_DOJI;

"Marubozu" . C'est un chandelier sans haut ni bas, ou ils sont très petits

(ombre inférieure) < (corps) * 0,03 ou (ombre supérieure) < (corps) * 0,03

//--- maribozu
   if((shade_low<res.bodysize*0.01 || shade_high<res.bodysize*0.01) && res.bodysize>0)
     {
      if(res.type==CAND_LONG)
         res.type=CAND_MARIBOZU_LONG;
      else
         res.type=CAND_MARIBOZU;
     }

Lors de la rédaction d'un indicateur pour cet article, il a fallu séparer les "longs" "Maribozu", pour lesquels j'ai dû ajouter la condition de vérification des chandeliers "longs".

"Le marteau" et "L’Homme pendu".  Le corps se trouve dans la partie supérieure de la plage quotidienne et l'ombre inférieure est beaucoup plus longue que le corps. Il faut également tenir compte de la longueur de l'ombre supérieure, s'il y en a. Le rapport entre le corps et l'ombre inférieure est défini comme le rapport de la longueur du corps à la longueur de l'ombre inférieure :

(ombre inférieure)>(corps)*2 et (ombre supérieure)< (corps)*0.1

//--- hammer
   if(shade_low>res.bodysize*2 && shade_high<res.bodysize*0.1) res.type=CAND_HAMMER;

"Étoile Filante" et "Marteau Inversé" sont similaires au "Marteau", mais avec la condition opposée :

(ombre inférieure)<(corps)*0.1 et (ombre supérieure)> (corps)*2

//--- invert hammer
   if(shade_low<res.bodysize*0.1 && shade_high>res.bodysize*2) res.type=CAND_INVERT_HAMMER;

"Toupies Roulantes". Ce sont des chandeliers "courts" avec des ombres plus longues que le corps :

(ombre inférieure) > (corps) et (ombre supérieure) > (corps)

//--- spinning top
   if(res.type==CAND_SHORT && shade_low>res.bodysize && shade_high>res.bodysize) res.type=CAND_SPIN_TOP;

Le texte source des descriptions de fonction et de structure se trouve dans le fichier joint CandlestickType.mqh. 

A; donc à l'article, l'indicateur Candlestick Type Color.mq5 est attaché, qui peint les chandeliers sur le graphique en fonction de leur type.


Figure 2. Exemple de chandelier de type Color.mq5

Nous avons donc créé une fonction qui renvoie toutes les données nécessaires.

Maintenant, nous pouvons poursuivre la création d’un indicateur qui identifiera les modèles de chandeliers.

3. modèles de chandeliers et algorithmes pour leur identification

Un modèle de chandelier peut être soit un seul chandelier, soit composé de plusieurs chandeliers, rarement plus de cinq ou six. En la littérature japonaise, ils font parfois référence aux motifs constitués d'un plus grand nombre de chandeliers. L'ordre dans lequel nous considérerons les modèles ne reflète pas leur importance ou leurs capacités prévisionnelles. 

Les modèles de chandeliers sont divisés en deux types - les modèles d'inversion et les modèles de continuation .

Nous considérerons d'abord des motifs simples (un chandelier) puis complexes (plusieurs chandeliers). La figure contenant le motif commencera par deux petites lignes verticales. Ces lignes indiquent simplement la direction de la tendance précédente du marché et ne doivent pas être utilisées comme une indication directe des relations entre les modèles.

Les motifs seront présentés dans un tableau, dans la première ligne - motif haussier, dans la seconde - motif baissier opposé, s'il y en a un.

3.1. MOTIFS D'INVERSION DES CHANDELIERS

3.1.1. Motifs consistant d'un seul chandelier

Obtenir des données pour un seul chandelier :

//--- calculation of candlestick patterns
   for(int i=limit;i<rates_total-1;i++)
     {
      CANDLE_STRUCTURE cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i],InpPeriodSMA,cand1))
         continue;
/* Checking patterns with one candlestick */

et identifier les modèles.

Nom du Motif Ordre Motif classique Forex Identification du motif
inversé
marteau
(haussier)

Achat

 Tendance à la baisse.
L'ombre supérieure n'est pas inférieure à 2 et pas plus de 3 fois plus grande que le corps.
Il n'y a pas d'ombre inférieure, ou elle est très courte (pas plus de 10 % de la fourchette du chandelier).
La couleur du corps dans le jeu long n'est pas importante, avec le marteau court - Celui blanc est beaucoup plus fort que le noir.
Une confirmation est suggérée.

Homme pendu
(baissier)

vente

 Tendance haussière.
L'ombre inférieure n'est pas inférieure à 2 et pas plus de 3 fois plus grande que le corps.
Il n'y a pas d'ombre supérieure, ou elle est très courte (pas plus de 10 % de la fourchette du chandelier).
La couleur du corps dans le jeu long n'est pas importante, avec le court - l’homme pendu noir est beaucoup plus fort que le blanc.
Une confirmation est suggérée.

      //------      
      // Inverted Hammer the bull model 
      if(cand1.trend==DOWN && // check the trend direction
         cand1.type==CAND_INVERT_HAMMER) // check the "inverted hammer"
        {
         comment=_language?"Inverted hammer";
         DrawSignal(prefix+"Inverted Hammer the bull model"+string(objcount++),cand1,InpColorBull,comment);
        }
      // Handing Man the bear model 
      if(cand1.trend==UPPER && // check the trend direction
         cand1.type==CAND_HAMMER) // check "hammer"
        {
         comment=_language?"Hanging Man";
         DrawSignal(prefix+"Hanging Man the bear model"+string(objcount++),cand1,InpColorBear,comment);
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Marteau
(haussier)

Achat

 Tendance à la baisse.
L'ombre inférieure n'est pas inférieure à 2 et pas plus de 3 fois plus grande que le corps.
Il n'y a pas d'ombre supérieure, ou elle est très courte (pas plus de 10 % de la fourchette du chandelier).
La couleur du corps dans le jeu long n'est pas importante, avec le marteau court - Celui blanc est beaucoup plus fort que le noir.
Une confirmation est suggérée.
Étoile filante
(baissier)

vente

 Tendance haussière.
L'ombre supérieure n'est pas moins de 3 fois plus grande que le corps.
Il n'y a pas d'ombre inférieure, ou elle est très courte (pas plus de 10 % de la fourchette du chandelier).
L'écart de prix entre l'étoile et le précédant chandelier
 Forex : les cours de clôture du chandelier précédent et d'ouverture de l'étoile sont égaux.
La couleur du corps n'a pas d'importance.
Une confirmation est suggérée.

      //------      
      // Hammer the bull model 
      if(cand1.trend==DOWN && //check the trend direction
         cand1.type==CAND_HAMMER) // check the hammer
        {
         comment=_language?"Hammer";
         DrawSignal(prefix+"Hammer the bull model"+string(objcount++),cand1,InpColorBull,comment);
        }
      //------      
      // Shooting Star the bear model 
      if(cand1.trend==UPPER && cand2.trend==UPPER && //check the trend direction
         cand2.type==CAND_INVERT_HAMMER) // check the inverted hammer
        {
         comment=_language?"Shooting Star";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open) // close 1 less equal open 1
              {
               DrawSignal(prefix+"Shooting Star the bear model"+string(objcount++),cand2,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.close<cand2.close) // 2 candlestick detached from 1
              {
               DrawSignal(prefix+"Shooting Star the bear model"+string(objcount++),cand2,InpColorBear,comment);
              }
           }
        }

Je voudrais attirer votre attention sur le fait que dans le cas de "Étoile Filante" nous avons en fait besoin de deux chandeliers, car conformément aux conditions d’identification du corps du jour précédant est prise en compte.

Nom du Motif Ordre Motif classique Forex Identification du motif
Maintien de la ceinture
(haussier)



Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
Ouverture d'un chandelier avec un grand écart dans la direction de la tendance.
 Chandelier blanc — «marubozu» «long».
 Le corps du chandelier blanc est beaucoup plus grand que le corps du chandelier précédent.
Une confirmation est suggérée.
Maintien de la ceinture
(baissier)


vente

Le motif
n'est pas
implémenté
 Tendance haussière.
Ouverture d'un chandelier avec un grand écart dans la direction de la tendance.
Chandelier noir — «marubozu» «long».
 Le corps du chandelier noir est beaucoup plus grand que le corps du chandelier précédent.
Une confirmation est suggérée.

      //------      
      // Belt Hold the bull model 
      if(cand2.trend==DOWN && cand2.bull && !cand1.bull &&// check the trend direction and direction of the candlestick
         cand2.type==CAND_MARIBOZU_LONG && // check the "long" marubozu
         cand1.bodysize<cand2.bodysize && cand2.close<cand1.close) // the body of the first candlestick is smaller than the body of the second one, close of the second one is below the close of the first
        {
         comment=_language?"Belt Hold";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Belt Hold the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
           }
        }
      // Belt Hold the bear model
      if(cand2.trend==UPPER && !cand2.bull && cand1.bull && // check the trend direction and direction of the candlestick
         cand2.type==CAND_MARIBOZU_LONG && // check the "long" marubozu
         cand1.bodysize<cand2.bodysize && cand2.close>cand1.close) // the body of the first candlestick is smaller than the body of the second one, close of the second one is above the close of the first
        {
         comment=_language?"Belt Hold";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Belt Hold the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
           }
        }

Comme dans le cas de l’ "Étoile Filante", deux chandeliers sont utilisés, car le corps du jour précédent est pris en compte pour l’identification du motif.

3.1.2. Motifs composés de deux chandeliers

Ajoutez une autre bougie :

/* Checking patterns with two candlesticks */
      CANDLE_STRUCTURE cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-1],InpPeriodSMA,cand1))
         continue;

et identifiez les motifs:

Nom du Motif Ordre Motif classique Forex Identification du motif
engloutissant
(haussier)

Achat

 Tendance à la baisse.
Le corps du deuxième chandelier recouvre entièrement le corps du premier.
 Forex : Clôture du chandelier noir et Ouverture du blanc avec une seule allumette.
Les ombres n'ont pas d'importance.
Une confirmation est suggérée.

engloutissant
(baissier)

vente

 Tendance haussière.
Le corps du deuxième chandelier recouvre entièrement le corps du premier.
 Forex : Clôture du chandelier blanc et Ouverture de l’allumette noire.
Les ombres n'ont pas d'importance.
Une confirmation est suggérée.

      //------      
      // Engulfing the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand2.trend==DOWN && cand2.bull && // check the trend direction and direction of the candlestick
         cand1.bodysize<cand2.bodysize) // the body of the second candlestick is larger than that of the first
        {
         comment=_language?"Engulfing";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open && cand1.open<cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Engulfing the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.open<cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Engulfing the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
        }
      // Engulfing the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.trend==UPPER && !cand2.bull && // check the trend direction and direction of the candlestick
         cand1.bodysize<cand2.bodysize) // the body of the second candlestick is larger than that of the first
        {
         comment=_language?"Engulfing";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open && cand1.open>cand2.close) //the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Engulfing the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.open>cand2.close) // close 1 less equal to open 2 or open 1 larger equal to close 2
              {
               DrawSignal(prefix+"Engulfing the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Croix Harami (taureau)

Achat

 Tendance à la baisse.
Le premier chandelier du motif est long noir.
Doji est à portée du premier chandelier, ombres comprises.
 Forex : doji est au niveau de Clôture du premier chandelier. Si les ombres Doji sont courtes, le motif doit être considéré comme une étoile Doji pour le forex.
Une confirmation est suggérée.

Croix Harami
(baissier)

vente

 Tendance haussière.
Le premier chandelier du motif est long blanc.
Doji est à portée du premier chandelier, ombres comprises.
 Forex : doji est au niveau de Clôture du premier chandelier. Si les ombres Doji sont courtes, le motif doit être considéré comme une étoile Doji pour le forex.
Une confirmation est suggérée.

      //------      
      // Harami Cross the bull model
      if(cand1.trend==DOWN && !cand1.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && cand2.type==CAND_DOJI) // checking the "long" first candlestick and doji
        {
         comment=_language?""Harami Cross";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open && cand1.close<=cand2.close && cand1.open>cand2.close) // doji inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami Cross the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.close<cand2.close && cand1.open>cand2.close) // doji inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami Cross the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
        }
      // Harami Cross the bear model
      if(cand1.trend==UPPER && cand1.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && cand2.type==CAND_DOJI) //  checking the "long" candlestick and doji
        {
         comment=_language?"Harami Cross";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open && cand1.close>=cand2.close && cand1.close>=cand2.close) //  doji inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami Cross the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.close>cand2.close && cand1.open<cand2.close) //  doji inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami Cross the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Harami
(haussier)

Achat

 Tendance à la baisse.
 Le corps du premier chandelier "long" engloutit complètement le corps du second.
Les ombres n'ont pas d'importance.
Forex : Clôture du chandelier noir et ouverture de l'allumette blanche.
Une confirmation est suggérée.

Harami
(baissier)

vente

 Tendance haussière.
 Le corps du premier chandelier "long" engloutit complètement le corps du second.
Les ombres n'ont pas d'importance.
Forex : Clôture du chandelier blanc et ouverture de l'allumette noire.
Une confirmation est suggérée.

      //------      
      // Harami the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand2.bull &&// check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) &&  // checking the "long"first candlestick
          cand2.type!=CAND_DOJI && cand1.bodysize>cand2.bodysize) // the second candlestick is not doji and the body of the first is larger than the body of the second
        {
         comment=_language?"Harami";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open && cand1.close<=cand2.close && cand1.open>cand2.close) // body of the second candlestick is inside the body of the first
              {
               DrawSignal(prefix+"Harami the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.close<cand2.close && cand1.open>cand2.close) // body of the second candlestick is inside the body of the first
              {
               DrawSignal(prefix+"Harami the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
              }
           }
        }
      // Harami the bear model
      if(cand1.trend==UPPER && cand1.bull && !cand2.bull &&// check the trend direction and direction of candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) &&  // checking the "long" first candlestick
          cand2.type!=CAND_DOJI && cand1.bodysize>cand2.bodysize) // the second candlestick is not doji and body of the first candlestick is larger than that of the second
        {
         comment=_language?"Harami";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open && cand1.close>=cand2.close && cand1.close>=cand2.close) // doji is inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.close>cand2.close && cand1.open<cand2.close) //doji is inside the body of the first candlestick
              {
               DrawSignal(prefix+"Harami the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Doji étoile
(haussier)

Achat

 Tendance à la baisse.
 Le premier chandelier du motif est long noir.
 La deuxième session - doji avec une rupture dans la direction de la tendance.
Forex : pas de pause.
Les ombres du doji sont courtes.
Une confirmation est suggérée.

Doji étoile
(baissier)

vente

 Tendance haussière.
Le premier chandelier du motif est long blanc.
 La deuxième session - doji avec une rupture dans la direction de la tendance.
Forex : pas de pause.
Les ombres du doji sont courtes.
Une confirmation est suggérée.

      //------      
      // Doji Star the bull model 
      if(cand1.trend==DOWN && !cand1.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && cand2.type==CAND_DOJI) // checking 1 "long" candlestick and 2 doji
        {
         comment=_language?"Doji Star";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open) // open of doji is below or equal to close of the first candlestick
              {
               DrawSignal(prefix+"Doji Star the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);

              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.close>cand2.close) // the body of doji is alienated from the body of the first candlestick
              {
               DrawSignal(prefix+"Doji Star the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);

              }
           }
        }
      // Doji Star the bear model 
      if(cand1.trend==UPPER && cand1.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && cand2.type==CAND_DOJI) // checking 1 "long" candlestick and 2 doji
        {
         comment=_language?"Doji Star";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open) // // open of doji is above or equal to close of the first candlestick
              {
               DrawSignal(prefix+"Doji Star the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);

              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.close<cand2.close) // // the body of doji is alienated from the body of the first candlestick
              {
               DrawSignal(prefix+"Doji Star the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);

              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Motif de piercing
(haussier)

Achat

 Tendance à la baisse.
 Les deux chandeliers sont longs.
L'ouverture du chandelier blanc est en dessous du bas du noir.
 Forex : La clôture du chandelier noir et l'ouverture du blanc sont égales.
Le chandelier blanc est fermé à l'intérieur du chandelier noir et couvre plus de 50% du corps. (Pour les marchés boursiers : contrairement à la couverture nuageuse noire, cette exigence n'a pas d'exception.)
La confirmation n'est pas requise pour le modèle classique, elle l’est pour le Forex.
Couverture nuageuse sombre (ours)

vente

 Tendance haussière.
 Les deux chandeliers sont longs.
 L'ouverture du chandelier noir est au-dessus du haut du chandelier blanc.
 Forex : La clôture du chandelier blanc et l'ouverture du noir sont égales.
La bougie noire se ferme à l'intérieur du blanc et couvre plus de 50% du corps.
La confirmation n'est pas requise pour le modèle classique, elle l’est pour le Forex.

            //------      
            // Piercing line the bull model 
            if(cand1.trend==DOWN  &&  !cand1.bull  &&  cand2.trend==DOWN  &&  cand2.bull && // check the trend direction and direction of the candlestick
               (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
               cand2.close>(cand1.close+cand1.open)/2)// close of the second is above the middle of the first
              {
               comment=_language?"Piercing Line";
               if(_forex)// if forex
                 {
                  if(cand1.close>=cand2.open && cand2.close<=cand1.open)
                    {
                     DrawSignal(prefix+"Gleam in clouds"+string(objcount++),cand1,cand2,InpColorBull,comment);
                    }
                 }
               else
                 {
                  if(cand2.open<cand1.low && cand2.close<=cand1.open) // open of the second candlestick is below LOW of the first, 
                    {
                     DrawSignal(prefix+"Piercing Line"+string(objcount++),cand1,cand2,InpColorBull,comment);
                    }
                 }
              }
            // Dark Cloud Cover the bear model 
            if(cand1.trend==UPPER  &&  cand1.bull  &&  cand2.trend==UPPER && !cand2.bull && // check the trend direction and direction of the candlestick
               (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
               cand2.close<(cand1.close+cand1.open)/2)// close 2 is below the middle of the body of 1
              {
               comment=_language?"Dark Cloud Cover";
               if(_forex)// if forex
                 {
                  if(cand1.close<=cand2.open && cand2.close>=cand1.open)
                    {
                     DrawSignal(prefix+"Dark Cloud Cover"+string(objcount++),cand1,cand2,InpColorBear,comment);
                     
                    }
                 }
               else
                 {
                  if(cand1.high<cand2.open && cand2.close>=cand1.open)
                    {
                     DrawSignal(prefix+"Dark Cloud Cover"+string(objcount++),cand1,cand2,InpColorBear,comment);
                     
                    }
                 }
              }

Nom du Motif Ordre Motif classique Forex Identification du motif
Lignes de Rencontre
(haussier)

Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Le premier chandelier du motif est long noir.
 L'ouverture du chandelier blanc est avec un grand écart et est en dessous du bas du chandelier noir.
 Les prix de clôture des deux chandeliers sont les identiques.
 Le corps du chandelier blanc est plus grand que le corps du chandelier noir.
Une confirmation est suggérée.
Lignes de Rencontre
(baissier)

vente

Le motif
n'est pas
implémenté
 Tendance haussière.
Le premier chandelier du motif est long blanc.
 L'ouverture du chandelier noir est avec un grand écart et est au-dessus du haut du chandelier blanc.
 Les prix de clôture des deux chandeliers sont les identiques.
 Le corps du chandelier noir est plus grand que le corps du chandelier blanc.
Une confirmation est suggérée.

      // Meeting Lines the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand2.trend==DOWN && cand2.bull && // check the trend direction and the candlestick direction
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand1.close==cand2.close && cand1.bodysize<cand2.bodysize && cand1.low>cand2.open) // close prices are equal, size of the first one is less than of the second one, open of the second is below Low of the first
        {
         comment=_language?"Meeting Lines";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Meeting Lines the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
           }
        }
      // Meeting Lines the bear model 
      if(cand1.trend==UPPER && cand1.bull && cand2.trend==UPPER && !cand2.bull && // check the trend direction and the candlestick direction
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand1.close==cand2.close && cand1.bodysize<cand2.bodysize && cand1.high<cand2.open) // // close prices are equal, size of first is less than of second, open of the second is above High of the first
        {
         comment=_language?"Meeting Lines";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Meeting Lines the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Correspondance faible
(haussier)

Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Le premier chandelier du motif ne doit pas nécessairement être long.
 L'ouverture du deuxième chandelier se trouve à l'intérieur du corps du premier.
Les prix de clôture des deux prix sont les identiques.
il n'y a pas d'ombres inférieures ou elles sont très courtes.
Une confirmation est suggérée.

      //------      
      // Matching Low the bull model 
      if(cand1.trend==DOWN && !cand1.bull && cand2.trend==DOWN && !cand2.bull && // check the trend direction and the candlestick direction
         cand1.close==cand2.close && cand1.bodysize>cand2.bodysize) // close prices are equal, size of the first one is larger than of the second
        {
         comment=_language?"Matching Low";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Matching Low the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Pigeon voyageur<br1(haussier)
Pigeon voyageur haussier

Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Le premier chandelier du motif ne doit pas nécessairement être long.
 L'ouverture du deuxième chandelier se trouve à l'intérieur du corps du premier.
Les prix de clôture des deux prix sont les identiques.
il n'y a pas d'ombres inférieures ou elles sont très courtes.
Une confirmation est suggérée.

      //------      
      // Homing Pigeon the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand2.trend==DOWN && !cand2.bull && // check the trend direction and the candlestick direction
        (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) &&  // checking the "long" candlestick
         cand1.close<cand2.close && cand1.open>cand2.open) // body of the second is inside that of the first candlestick
        {
         comment=_language?"Homing Pigeon";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Homing Pigeon the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);   
           }
        }

 3.1.3. Motifs composés de trois chandeliers

/* Checking patterns with three candlesticks */
      CANDLE_STRUCTURE cand3;
      cand3=cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-2],InpPeriodSMA,cand1))
         continue;
Nom du Motif  Ordre  Motif classique Forex Identification du motif
Bébé abandonné
(haussier)

 

Achat

Le motif
n'est pas
implémenté

 Il s'agit d'un modèle d'inversion rare mais important.
Tendance à la baisse.
 Le premier chandelier du motif est long noir.
 Le deuxième chandelier est un doji avec un écart, et l'écart n'est pas seulement entre les corps des chandeliers, mais aussi entre les ombres.
Le troisième chandelier est un chandelier blanc "long" avec le même écart entre les ombres et Clôture à l'intérieur du corps du premier chandelier.

  Bébé abandonné
(baissier)

 

vente

  Le motif
n'est pas
implémenté

 Il s'agit d'un modèle d'inversion rare mais important.
Tendance haussière.
 Le premier chandelier du motif est long blanc.
 Le deuxième chandelier est un doji avec un écart, et l'écart n'est pas seulement entre les corps des chandeliers, mais aussi entre les ombres.
Le troisième chandelier est un chandelier noir "long" avec le même écart entre les ombres et Close à l'intérieur du corps du premier chandelier.

      //------      
      // The Abandoned Baby, the bullish model
      if(cand1.trend==DOWN && !cand1.bull && cand3.trend==DOWN && cand3.bull && // check direction of trend and direction of candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // check of "long" candlestick
         cand2.type==CAND_DOJI && // check if the second candlestick is Doji
         cand3.close<cand1.open && cand3.close>cand1.close) // the third one is closed inside of body of the first one
        {
         comment=_language?"Abandoned Baby (Bull)":"Abandoned Baby";
         if(!_forex)// if it's not forex
           {
            if(cand1.low>cand2.high && cand3.low>cand2.high) // gap between candlesticks
              {
               DrawSignal(prefix+"Abandoned Baby the bull model"+string(objcount++),cand1,cand1,cand3,InpColorBull,comment);
              }
           }
        }
      // The Abandoned Baby, the bearish model
      if(cand1.trend==UPPER && cand1.bull && cand3.trend==UPPER && !cand3.bull && // check direction of trend and direction of candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // check of "long" candlestick
         cand2.type==CAND_DOJI && // check if the second candlestick is Doji
         cand3.close>cand1.open && cand3.close<cand1.close) // // the third one is closed inside of body of the second one
        {
         comment=_language?"Abandoned Baby (Bear)":"Abandoned Baby";
         if(!_forex)// if it's not forex
           {
            if(cand1.high<cand2.low && cand3.high<cand2.low) // gap between candlesticks
              {
               DrawSignal(prefix+"Abandoned Baby the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }
Nom du Motif  Ordre Motif classique Forex Identification du motif
L'étoile du matin
(haussier)

Achat


 Tendance à la baisse.
 La première et la troisième séances sont des chandeliers "longs".
Les ombres des étoiles sont courtes, la couleur ne compte pas.
Séparation de l'étoile de la clôture du premier chandelier.
Forex : La clôture du premier chandelier et l'ouverture de l'étoile sont égales.
Le troisième chandelier est clôturé à l'intérieur du corps du premier.
 Étoile du soir
(baissier
)

 

vente

 

 

 Tendance haussière.
 La première et la troisième séances sont des chandeliers "longs".
Les ombres des étoiles sont courtes, la couleur ne compte pas.
Séparation de l'étoile de la clôture du premier chandelier.
Forex : La clôture du premier chandelier et l'ouverture de l'étoile sont égales.
Le troisième chandelier est clôturé à l'intérieur du corps du premier.
      // Morning star the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand3.trend==DOWN && cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand2.type==CAND_SHORT && // checking "short"
         cand3.close>cand1.close && cand3.close<cand1.open) // the third candlestick is closed inside the body of the first one
        {
         comment=_language?"Morning star";
         if(_forex)// if forex
           {
            if(cand2.open<=cand1.close) // open of the second candlestick is below or equal to close of the first one
              {
               DrawSignal(prefix+"Morning star the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
         else // another market
           {
            if(cand2.open<cand1.close && cand2.close<cand1.close) // separation of the second candlestick from the first one
              {
               DrawSignal(prefix+"Morning star the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Evening star the bear model
      if(cand1.trend==UPPER && cand1.bull && cand3.trend==UPPER && !cand3.bull && //check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand2.type==CAND_SHORT && // checking "short"
         cand3.close<cand1.close && cand3.close>cand1.open) // the third candlestick is closed inside the body of the first one
        {
         comment=_language?"Evening star";
         if(_forex)// if forex
           {
            if(cand2.open>=cand1.close) // open of the second is above or equal to close of the first one
              {
               DrawSignal(prefix+"Evening star the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
         else // another market
           {
            if(cand2.open>cand1.close && cand2.close>cand1.close) //  separation of the second candlestick from the first one
              {
               DrawSignal(prefix+"Evening star the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }
Nom du Motif  Ordre Motif classique Forex Identification du motif
Matin de l’étoile Doji
(haussier)

Achat



 Tendance à la baisse.
 Le premier chandelier du motif est long noir.
 La deuxième session - doji avec une rupture dans la direction de la tendance.
Forex : pas de pause.
Les ombres du doji sont courtes.
Le troisième chandelier est clôturé à l'intérieur du corps du premier.
Le soir de l’étoile Doji
(baissier)

vente



 Tendance haussière.
Le premier chandelier du motif est long blanc.
 La deuxième session - doji avec une rupture dans la direction de la tendance.
Forex : pas de pause.
Les ombres du doji sont courtes.
Une confirmation est suggérée.
      //------      
      // Morning Doji Star the bull model 
      if(cand1.trend==DOWN && !cand1.bull && cand3.trend==DOWN && cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand2.type==CAND_DOJI && // checking "doji"
         cand3.close>cand1.close && cand3.close<cand1.open) // third cand. is closed inside body of first
        {
         comment=_language?"Morning Doji Star";
         if(_forex)// if forex
           {
            if(cand2.open<=cand1.close) // open of doji is below or equal to close of the first
              {
               DrawSignal(prefix+"Morning Doji Star the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
         else // another market
           {
            if(cand2.open<cand1.close) // separation of doji from the first
              {
               DrawSignal(prefix+"Morning Doji Star the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Evening Doji Star the bear model
      if(cand1.trend==UPPER && cand1.bull && cand3.trend==UPPER && !cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand2.type==CAND_DOJI && // checking "doji"
         cand3.close<cand1.close && cand3.close>cand1.open) // third cand. is closed inside body of first
        {
         comment=_language?"Evening Doji Star";
         if(_forex)// if forex
           {
            if(cand2.open>=cand1.close) // open of doji is above or equal to close of the first
              {
               DrawSignal(prefix+"Evening Doji Star the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
         else // another market
           {
            if(cand2.open>cand1.close) // separation of doji from the first
               // check close 2 and open 3
              {
               DrawSignal(prefix+"Evening Doji Star the bear model"+string(objcount++),cand1,cand3,cand3,InpColorBear,comment);
              }
           }
        }
Nom du Motif Ordre Motif classique Forex Identification du motif
Écart haussier baissier des Deux Corbeaux

vente


Le motif
n'est pas
implémenté
 Tendance haussière.
Le premier chandelier est "long" blanc.
Un écart entre les chandeliers blancs et noirs.
Le troisième chandelier s'ouvre plus haut que le second et l'engloutit.
Une confirmation est suggérée.
 Le sens de la figure : si les prix ne pouvaient pas monter lors de la 4ème séance, il fallait s'attendre à ce que les prix baissent.
deux corbeaux
(baissier)

vente


Le motif
n'est pas
implémenté
 Tendance haussière.
Le premier chandelier du motif est long blanc.
L'écart entre le blanc et le premier chandelier noir.
Le troisième chandelier est noir et nécessairement « long » ; s'ouvre à l'intérieur ou au-dessus de la seconde et clôture à l'intérieur ou en dessous du chandelier blanc, couvrant l'écart.
Une confirmation est suggérée.
Si le deuxième corbeau (la troisième bougie) engloutit une bougie blanche, la confirmation n'est pas requise.
      //------      
      // Upside Gap Two Crows the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.trend==UPPER && !cand2.bull && cand3.trend==UPPER && !cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand1.close<cand2.close && cand1.close<cand3.close && // separation of the second and third from the first one
         cand2.open<cand3.open && cand2.close>cand3.close) // the third candlestick engulfs second
        {
         comment=_language?"Upside Gap Two Crows";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Upside Gap Two Crows the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
        }
      //------      
      // Two Crows the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.trend==UPPER && !cand2.bull && cand3.trend==UPPER && !cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG|| cand1.type==CAND_MARIBOZU_LONG) &&(cand3.type==CAND_LONG|| cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         cand1.close<cand2.close && // separation of the second from the first one
         cand3.open>cand2.close && // third one opens higher than close of the second
         cand3.close<cand1.close) // third one closes than close of the first
        {
         comment=_language?"Two Crows";
         if(!_forex)// if not forex
           {
            DrawSignal(prefix+"Two Crows the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
        }

Nom du Motif  Ordre Motif classique Forex Identification du motif
Trois étoiles dans le sud
(haussier)

Achat



 Tendance à la baisse.
Le premier chandelier est une longue journée noire avec une longue ombre inférieure.
Le deuxième chandelier est plus court que le premier, son plus bas est au-dessus du plus bas du premier chandelier.
Le troisième chandelier est un petit marubozu noir ou une étoile, un jour interne par rapport à la deuxième séance.
Une confirmation est suggérée.
Délibération
(baissier)

vente



 Tendance haussière.
Trois chandeliers blancs avec des prix de clôture plus élevés. Les deux premiers chandeliers sont des journées longues.
Le prix d'ouverture de chaque chandelier est à l'intérieur du corps du précédent.
 Forex : les prix d'ouverture/de clôture des chandeliers blancs sont identiques.
 Le troisième chandelier s'ouvre à peu près au niveau de clôture du deuxième chandelier.
 le troisième chandelier est une étoile ou une toupie tournante.
Une confirmation est suggérée.

      //------      
      // Three Star in the South the bull model

      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && !cand3.bull && //check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand3.type==CAND_MARIBOZU || cand3.type==CAND_SHORT) && // checking the "long" candlestick and marubozu
         cand1.bodysize>cand2.bodysize && cand1.low<cand2.low && cand3.low>cand2.low && cand3.high<cand2.high)
        {
         comment=_language?"Three Star in the South";
         if(_forex)// if forex
           {
            DrawSignal(prefix+"Three Star in the South the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
         else // another market
           {
            if(cand1.close<cand2.open && cand2.close<cand3.open) // open is inside the previous candlestick
              {
               DrawSignal(prefix+"Three Star in the South the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Deliberation the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.bull && cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick
         (cand3.type==CAND_SPIN_TOP || cand3.type==CAND_SHORT)) // the third candlestick is a star or spinning top
        {
         comment=_language?"Deliberation";
         if(_forex)// if forex
           {
            DrawSignal(prefix+"Deliberation the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
         else // another market
           {
            if(cand1.close>cand2.open && cand2.close<=cand3.open) // open is inside the previous candlestick
               // check close 2 and open 3
              {
               DrawSignal(prefix+"Deliberation the bear model"+string(objcount++),cand1,cand3,cand3,InpColorBear,comment);
              }
           }
        }

Nom du Motif  Ordre Motif classique Forex Identification du motif
Trois soldats blancs
(haussier)

Achat



 Tendance à la baisse.
 Trois longs chandeliers blancs apparaissent l'un après l'autre, les cours de clôture de chacun d'eux sont plus élevés que celui du précédent.
 Le prix d'ouverture de chaque soldat est à l'intérieur du corps du chandelier précédent.
 Forex : La clôture/l'ouverture des soudures sont les identiques.
 Les ombres supérieures des soldats sont courtes.
La confirmation n'est pas requise.
Trois corbeaux noirs
(baissier)

vente


Le motif
n'est pas
implémenté
 Tendance haussière.
 Trois longs chandeliers noirs apparaissent l'un après l'autre, les cours de clôture de chacun d'eux sont inférieurs à celui du précédent.
 Le prix d'ouverture de chaque corbeau est à l'intérieur du corps du chandelier précédent.
 Forex : correspond au motif identique à trois corbeaux.
 Les ombres inférieures des corbeaux sont courtes.
La confirmation n'est pas requise.

      //------      
      // Three White Soldiers the bull model
      if(cand1.trend==DOWN && cand1.bull && cand2.bull && cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick and marubozu
         (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG)) // checking the "long" candlestick and marubozu
        {
         comment=_language?"Three White Soldiers";
         if(_forex)// if forex
           {
            DrawSignal(prefix+"Three White Soldiers the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
         else // another market
           {
            if(cand1.close>cand2.open && cand2.close>cand3.open) // open inside the previous candlestick
              {
               DrawSignal(prefix+"Three White Soldiers the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Three Black Crows the bear model
      if(cand1.trend==UPPER && !cand1.bull && !cand2.bull && !cand3.bull && //check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick and marubozu
         (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick and marubozu
         cand1.close<cand2.open && cand2.close<cand3.open)
        {
         comment=_language?"Three Black Crows";
         if(!_forex) // non-forex
           {
               DrawSignal(prefix+"Three Black Crows the bear model"+string(objcount++),cand1,cand3,cand3,InpColorBear,comment);
           }
        }

Nom du Motif  Ordre Motif classique Forex Identification du motif
Trois à l'extérieur vers le haut
(haussier)

Achat



 Tendance à la baisse.
 Tout d'abord, le motif d'Engloutissement (taureau) est formé : le corps du deuxième chandelier recouvre complètement le corps du premier.
 Forex : La clôture d'un chandelier noir et l'ouverture du chandelier blanc sont égales.
Les ombres n'ont pas d'importance.
 Ensuite, le troisième jour, il y a une clôture plus élevée.
La confirmation n'est pas requise : le motif lui-même est une confirmation pour le taureau engloutissant
Trois à l'extérieur vers le bas
(baissier)

vente



 Tendance haussière.
 Tout d'abord, le motif d'Engloutissement (ours) est formé : le corps du deuxième chandelier recouvre complètement le corps du premier.
 Forex : Clôture du chandelier blanc et Ouverture de la première allumette noire.
Les ombres n'ont pas d'importance.
 Ensuite, le troisième jour, il y a une clôture inférieure.
La confirmation n'est pas requise : le motif lui-même est une confirmation à l'ours engloutissant

      //------      
      // Three Outside Up the bull model
      if(cand1.trend==DOWN && !cand1.bull && cand2.trend==DOWN && cand2.bull && cand3.bull && // check the trend direction and direction of the candlestick
         cand2.bodysize>cand1.bodysize && // the body of the second candlestick is larger than that of the first
         cand3.close>cand2.close) // the third day is closed higher than the second
        {
         comment=_language?"Three Outside Up";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open && cand1.open<cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Three Outside Up the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.open<cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Three Outside Up the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Three Outside Down the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.trend==UPPER && !cand2.bull && !cand3.bull && // check the trend direction and direction of the candlestick
         cand2.bodysize>cand1.bodysize && // the body of the second candlestick is larger than that of the first
         cand3.close<cand2.close) // the third day is closed lower than the second
        {
         comment=_language?"Three Outside Down";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open && cand1.open>cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Three Outside Down the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.open>cand2.close) // the body of the first candlestick is inside the body of the second
              {
               DrawSignal(prefix+"Three Outside Down the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }

Nom du Motif  Ordre Motif classique Forex Identification du motif
Trois à l'intérieur vers le haut
(haussier)

Achat



 Tendance à la baisse.
 Au cours des deux premières séances, le motif Harami (taureau) est formé : un petit corps blanc est englouti par un grand noir.
 La clôture de la troisième séance est supérieure au plus haut des deux premiers chandeliers.
La confirmation n'est pas requise : le motif lui-même est une confirmation au taureau Harami.
Trois à l'intérieur vers le bas
(baissier)

vente



 Tendance haussière.
 Au cours des deux premières séances, le motif Harami (ours) est formé : un petit corps noir est englouti par un grand blanc.
 La clôture de la troisième séance est inférieure au plus bas des deux premiers chandeliers.
Aucune confirmation n'est requise : le motif lui-même est une confirmation à l'ours Harami.

      //------      
      // Three Inside Up the bull model
      if(cand1.trend==DOWN  &&  !cand1.bull  &&  cand2.bull && cand3.bull && //check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) &&  //checking the "long" candlestick 
         cand1.bodysize>cand2.bodysize && // the body of the first candlestick is larger than that of the second one
         cand3.close>cand2.close) // the third day closes higher than the second
        {
         comment=_language?"Three Inside Up";
         if(_forex)// if forex
           {
            if(cand1.close<=cand2.open && cand1.close<=cand2.close && cand1.open>cand2.close) // the body of the second candlestick is inside the body of the first one
              {
               DrawSignal(prefix+"Three Inside Up the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
         else
           {
            if(cand1.close<cand2.open && cand1.close<cand2.close && cand1.open>cand2.close) // the body of the second candlestick is inside the body of the first one
              {
               DrawSignal(prefix+"Three Inside Up the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Three Inside Down the bear model
      if(cand1.trend==UPPER && cand1.bull && !cand2.bull && !cand3.bull &&//check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick 
         cand1.bodysize>cand2.bodysize && // the body of the first candlestick is larger than that of the second one
         cand3.close<cand2.close) // the third day closes lower than the second
        {
         comment=_language?"Three Inside Down";
         if(_forex)// if forex
           {
            if(cand1.close>=cand2.open && cand1.close>=cand2.close && cand1.close>=cand2.close) // inside the body of the first candlestick
              {
               DrawSignal(prefix+"Three Inside Down the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
         else
           {
            if(cand1.close>cand2.open && cand1.close>cand2.close && cand1.open<cand2.close) // inside the body of the first candlestick
              {
               DrawSignal(prefix+"Three Inside Down the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }

Nom du Motif  Ordre Motif classique Forex Identification du motif
Trois étoiles
(haussier)

Achat



 Tendance à la baisse.
L'écart entre le premier doji et les chandeliers précédents n'est pas requis.
 Tous les trois chandeliers sont des doji.
 Le doji du milieu a un écart vers le haut ou vers le bas.
 Forex : tous les trois doji sont sur un même niveau.
Une confirmation est suggérée.
Trois étoiles
(baissier)

vente



 Tendance haussière.
L'écart entre le premier doji et les chandeliers précédents n'est pas requis.
 Tous les trois chandeliers sont des doji.
 Le doji du milieu a un écart vers le haut ou vers le bas.
 Forex : tous les trois doji sont sur un même niveau.
Une confirmation est suggérée.

      //------      
      // Three Stars the bull model
      if(cand1.trend==DOWN  && // check the trend direction
         cand1.type==CAND_DOJI && cand2.type==CAND_DOJI && cand3.type==CAND_DOJI) // check doji
        {
         comment=_language?"Bullish Three Stars";
         if(_forex)// if forex
           {
               DrawSignal(prefix+"Three Stars the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
         else
           {
            if(cand2.open!=cand1.close && cand2.close!=cand3.open) // the second candlestick is on a different level
              {
               DrawSignal(prefix+"Three Stars the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
              }
           }
        }
      // Three Stars the bear model
      if(cand1.trend==UPPER && // check the trend direction
         cand1.type==CAND_DOJI && cand2.type==CAND_DOJI && cand3.type==CAND_DOJI) // check doji
        {
         comment=_language?"Bearish Three Stars";
         if(_forex)// if forex
           {
               DrawSignal(prefix+"Three Stars the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
         else
           {
            if(cand2.open!=cand1.close && cand2.close!=cand3.open) //  the second candlestick is on a different level
              {
               DrawSignal(prefix+"Three Stars the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Trois corbeaux identiques
(baissier)

vente



 Tendance haussière.
 Trois longs chandeliers noirs apparaissent l'un après l'autre, les cours de clôture de chacun d'eux sont inférieurs à celui du précédent.
 Le prix d'ouverture de chaque corbeau est approximativement égal à la clôture du chandelier précédent.
 Les ombres inférieures des corbeaux sont courtes.
La confirmation n'est pas requise.

      // Identical Three Crows the bear model
      if(cand1.trend==UPPER && !cand1.bull && !cand2.bull && !cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // checking the "long" candlestick or marubozu
         (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG)) // checking the "long" candlestick or marubozu
        {
         comment=_language?"Identical Three Crows";
         if(_forex)// if forex
           {
            DrawSignal(prefix+"Identical Three Crows the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
         else // a different market
           {
            if(cand1.close>=cand2.open && cand2.close>=cand3.open) // open is less or equal to close of the preceding candlestick
              {
               DrawSignal(prefix+"Identical Three Crows the bear model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
              }
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
Fond unique de trois rivières
(haussier)

Achat


Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Le premier chandelier du modèle est un long noir avec des ombres courtes.
 Au deuxième jour, Harami apparaît, mais avec un corps noir.
 L'ombre inférieure du deuxième jour affiche une nouvelle baisse.
Le troisième jour est un jour blanc court inférieur au jour du milieu.
La confirmation n'est pas nécessaire mais souhaitable.

      // Unique Three River Bottom the bull model
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && cand3.bull && // check the trend direction and the candlestick direction
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && cand3.type==CAND_SHORT && // check the "long" candlestick or "marubozu" third short day
         cand2.open<cand1.open && cand2.close>cand1.close && cand2.low<cand1.low && // body of the second candlestick is inside the first, Low is lower than the first
         cand3.close<cand2.close) // the third candlestick is below the second
        {
         comment=_language?"Unique Three River Bottom";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Unique Three River Bottom the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
        }

3.1.4. Motifs composés de quatre chandeliers

/* Checking patterns with four candlesticks */      
      CANDLE_STRUCTURE cand4;
      cand4=cand3;
      cand3=cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-3],InpPeriodSMA,cand1))
         continue

Nom du Motif Ordre Motif classique Forex Identification du motif
Annuler le bébé hirondelle (taureau)


Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Les deux premières séances sont deux marubozu noirs.
 La troisième session s'ouvre sur une cassure, mais le trade est effectué à l'intérieur du corps du deuxième chandelier, ce qui conduit à la formation d'une longue ombre supérieure.
 Le quatrième chandelier noir engloutit complètement le troisième, y compris l'ombre.
La confirmation n'est pas requise.

      //------      
      // Concealing Baby Swallow the bull model
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && !cand3.bull && !cand4.bull && // check the trend direction and the candlestick direction
         cand1.type==CAND_MARIBOZU_LONG && cand2.type==CAND_MARIBOZU_LONG && cand3.type==CAND_SHORT && // checking "marubozu"
         cand3.open<cand2.close && cand3.high>cand2.close && // third candlestick with a gap down, High is inside the 2nd candlestick
         cand4.open>cand3.high && cand4.close<cand3.low) // the fourth candlestick completely engulfs the third
        {
         comment=_language?"Concealing Baby Swallow";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Concealing Baby Swallow the bull model"+string(objcount++),cand1,cand2,cand4,InpColorBull,comment);
           }
        }

3.1.5. Motifs composés de deux chandeliers

/* Checking patterns with five candlesticks */
      CANDLE_STRUCTURE cand5;
      cand5=cand4;
      cand4=cand3;
      cand3=cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-4],InpPeriodSMA,cand1))
         continue

Nom du Motif  Ordre Motif classique Forex Identification du motif
Se détacher
(haussier)

Achat

Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Les deux premières sessions — un chandelier noir "long" et un chandelier noir "court" (étoile) avec un écart.
 La troisième session est "courte", peut être de n'importe quelle couleur.
 Le quatrième chandelier est "Court" noir.
 Le cinquième est "long" blanc avec Clôture à l'intérieur de l'écart.
Une confirmation est suggérée.
Se détacher
(baissier)

vente

Le motif
n'est pas
implémenté
 Tendance haussière.
 Les deux premières sessions — un chandelier blanc "long" et un chandelier blanc "court" (étoile) avec un écart.
 La troisième séance est un chandelier "court", peut être de n'importe quelle couleur.
Le quatrième jour est "court" blanc.
 Le cinquième est "long" noir avec Clôture à l'intérieur de l'écart.
Une confirmation est suggérée.

      //------      
      // Breakaway the bull model
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && !cand4.bull && cand5.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG|| cand1.type==CAND_MARIBOZU_LONG) &&  //checking the "long" first candlestick
         cand2.type==CAND_SHORT && cand2.open<cand1.close && // the second is "short", separated from the first
         cand3.type==CAND_SHORT && cand4.type==CAND_SHORT && // third and fourth are "short"
         (cand5.type==CAND_LONG || cand5.type==CAND_MARIBOZU_LONG) && cand5.close<cand1.close && cand5.close>cand2.open) // fifth is "long" white with close inside the gap
        {
         comment=_language?"Bullish Breakaway";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Breakaway the bull model"+string(objcount++),cand1,cand2,cand5,InpColorBull,comment);
           }
        }
      // Breakaway the bear model
      if(cand1.trend==UPPER && cand1.bull && cand2.bull && cand4.bull && !cand5.bull && //  check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG|| cand1.type==CAND_MARIBOZU_LONG) &&  // checking the "long" first candlestick
         cand2.type==CAND_SHORT && cand2.open<cand1.close && // the second is "short", separated from the first
         cand3.type==CAND_SHORT && cand4.type==CAND_SHORT && // third and fourth are "short"
         (cand5.type==CAND_LONG || cand5.type==CAND_MARIBOZU_LONG) && cand5.close>cand1.close && cand5.close<cand2.open) // fifth is "long" black with close inside the gap
        {
         comment=_language?"Bearish Breakaway";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Breakaway the bear model"+string(objcount++),cand1,cand2,cand5,InpColorBear,comment);
           }
        }

3.2. MODÈLES DE CONTINUATION

Les modèles de continuation sont le moment où le marché se repose.

Quel que soit le modèle, vous devez prendre une décision sur votre position actuelle, même si c'est pour ne rien changer.

3.2.1. Motifs constitués d'un seul chandelier

Nom du Motif  Ordre Motif classique Forex Identification du motif
Coup de pied
(haussier)

Achat

Le motif
n'est pas
implémenté
 Le "marubozu" noir est suivi du "marubozu" blanc.
 Il y a un écart entre les corps.
La confirmation n'est pas requise.
Coup de pied
(baissier)

vente

Le motif
n'est pas
implémenté
 Le "marubozu" blanc est suivi du "marubozu" noir.
 Il y a un écart entre les corps.
La confirmation n'est pas requise.

      //------      
      // Kicking the bull model
      if(!cand1.bull && cand2.bull && // check the trend direction and direction of the candlestick
         cand1.type==CAND_MARIBOZU_LONG && cand2.type==CAND_MARIBOZU_LONG && // two marubozu
         cand1.open<cand2.open) // a gap between them
        {
         comment=_language?"Bullish Kicking";
         if(!_forex)// if non-forex
           {
            DrawSignal(prefix+"Kicking the bull model"+string(objcount++),cand1,cand2,InpColorBull,comment);
           }
        }
      // Kicking the bear model
      if(cand1.bull && !cand2.bull && // check the trend direction and direction of the candlestick
         cand1.type==CAND_MARIBOZU_LONG && cand2.type==CAND_MARIBOZU_LONG && // two marubozu
         cand1.open>cand2.open) // a gap between them
        {
         comment=_language?"Bearish Kicking";
         if(!_forex)// if non-forex
           {
            DrawSignal(prefix+"Kicking the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
           }
        }

3.2.2. Motifs composés de deux chandeliers

Nom du Motif  Ordre Motif classique Forex Identification du motif
 Baissier sur la ligne de cou

 

vente

   Le motif
n'est pas
implémenté
 Tendance à la baisse.
Le premier chandelier du motif est long noir.
 Le chandelier blanc clôture en dessous du bas du chandelier noir et clôture à peu près au bas du chandelier noir.
 Le chandelier blanc - pas nécessairement une longue journée.
Une confirmation est suggérée.
Dans la ligne de cou
(baissier)

vente

Le motif
n'est pas
implémenté
 Tendance à la baisse.
Le premier chandelier du motif est long noir.
 Le chandelier blanc s'ouvre en dessous du bas du chandelier noir et ferme un peu plus haut que la clôture du chandelier noir.
 Le chandelier blanc - pas nécessairement une longue journée.
 Le corps du chandelier blanc est plus petit que le corps du chandelier noir.
 L'ombre supérieure du chandelier blanc est très petite.
Une confirmation est suggérée.
Ligne de poussée
(baissier)

vente


Le motif
n'est pas
implémenté
 Tendance à la baisse.
Le premier chandelier du motif est long noir.
 Le chandelier blanc s'ouvre en dessous du bas du chandelier noir et clôture plus haut que la clôture du chandelier noir, mais le prix de clôture est toujours en dessous du milieu du chandelier noir.
 Le chandelier blanc - pas nécessairement une longue journée.
Une confirmation est suggérée.

Ces trois modèles ont beaucoup en commun, leur mise en œuvre est donc quelque peu différente, veuillez y prêter attention.

      //------ Check On Neck patterns
      if(cand1.trend==DOWN && !cand1.bull && cand2.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG)) // the first candlestick is "long"
        {
         // On Neck Line the bear model
         if(cand2.open<cand1.low && cand2.close==cand1.low) // the second candlestick opens below 1st and closes at Low of the first
           {
            comment=_language?"On Neck Line Bear";
            if(!_forex)// if not forex
              {
               DrawSignal(prefix+"On Neck Line the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
              }
           }
         else
           {
            // In Neck Line the bear model
            if(cand1.trend==DOWN && !cand1.bull && cand2.bull && // check the trend direction and direction of the candlestick
               (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && // the first candlestick is "long"
               cand1.bodysize>cand2.bodysize && // body of 2nd candlestick is smaller than that of the 1st one
               cand2.open<cand1.low && cand2.close>=cand1.close && cand2.close<(cand1.close+cand1.bodysize*0.01)) // the second candlestick opens lower than first and closes a little higher than Close of the first
              {
               comment=_language?"In Neck Line Bear";
               if(!_forex)// если не форекс
                 {
                  DrawSignal(prefix+"In Neck Line the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
                 }
              }
            else
              {
               // Thrusting Line the bear model
               if(cand1.trend==DOWN && !cand1.bull && cand2.bull && // check the trend direction and direction of the candlestick
                  (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && // the first candlestick is "long"
                  cand2.open<cand1.low && cand2.close>cand1.close && cand2.close<(cand1.open+cand1.close)/2) //  the second candlestick opens lower than first and closes a higher than Close of the first but lower than middle
                 {
                  comment=_language?"Thrusting Line Bea";
                  if(!_forex)// if non-forex
                    {
                     DrawSignal(prefix+"Thrusting Line the bear model"+string(objcount++),cand1,cand2,InpColorBear,comment);
                    }
                 }
              }
           }
        }

3.2.3. Motifs composés de trois chandeliers

Nom du Motif Ordre Motif classique Forex Identification du motif
Écart à la hausse trois méthodes
(haussier)


Achat


Le motif
n'est pas
implémenté
 Tendance haussière.
 Les deux premiers chandeliers sont deux chandeliers blancs "longs" avec un écart.
 Le troisième chandelier s'ouvre à l'intérieur du corps du second et comble l’écart.
Une confirmation est suggérée.
Écart à la hausse trois méthodes
(baissier)


vente


Le motif
n'est pas
implémenté
 Tendance à la baisse.
 Les deux premiers chandeliers sont deux chandeliers noirs "longs" avec un écart.
 Le troisième chandelier s'ouvre à l'intérieur du corps du second et comble l’écart.
Une confirmation est suggérée.

      //------      
      // Upside Gap Three Methods the bull model
      if(cand1.trend==UPPER && cand1.bull && cand2.bull && !cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // the first two candlesticks are "long"
         cand2.open>cand1.close && // a gap between the first and the second
         cand3.open>cand2.open && cand3.open<cand2.close && cand3.close<cand1.close) // the third candlestick opens inside the body of the second and fills in the gap
        {
         comment=_language?"Upside Gap Three Methods";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Upside Gap Three Methods the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
        }
      //------      
      // Downside Gap Three Methods the bull model
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && cand3.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // the first two candlesticks are "long"
         cand2.open<cand1.close && // a gap between the first and the second
         cand3.open<cand2.open && cand3.open>cand2.close && cand3.close>cand1.close) //the third candlestick opens inside the body of the second and fills in the gap
        {
         comment=_language?"Downside Gap Three Methods";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Downside Gap Three Methods the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
        }

Nom du Motif Ordre Motif classique Forex Identification du motif
L'écart de Tasuki à l'envers
(haussier)


Achat


<
Le motif
n'est pas
implémenté
 Tendance haussière.
L'écart entre deux bougies blanches voisines. Les chandeliers blancs ne sont pas forcément "longs".
La troisième session s'ouvre dans le corps du deuxième chandelier.
La troisième session clôture à l'intérieur de l'écart, mais l'écart est partiellement non comblé.
Une confirmation est suggérée.
Ecart Tasuki inconvénient
(baissier)


vente

Le motif
n'est pas
implémenté
 Tendance à la baisse.
L'écart entre deux bougies noires voisines. Les chandeliers noirs ne sont pas forcément "longs".
La troisième session s'ouvre dans le corps du deuxième chandelier.
La troisième session clôture à l'intérieur de l'écart, mais l'écart est partiellement non comblé.
Une confirmation est suggérée.

      //------      
      // Upside Tasuki Gap the bull model
      if(cand1.trend==UPPER && cand1.bull && cand2.bull && !cand3.bull && // check the trend direction and direction of the candlestick
         cand1.type!=CAND_DOJI && cand2.type!=CAND_DOJI && // the first two candlesticks are not doji
         cand2.open>cand1.close && // a gap between the first and the second
         cand3.open>cand2.open && cand3.open<cand2.close && cand3.close<cand2.open && cand3.close>cand1.close) // 3rd candlestick opens inside 2nd and closes inside the gap
        {
         comment=_language?"Upside Tasuki Gap";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Upside Tasuki Gap the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBull,comment);
           }
        }
      //------      
      // Downside Tasuki Gap the bull model
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && cand3.bull && // check the trend direction and direction of the candlestick
         cand1.type!=CAND_DOJI && cand2.type!=CAND_DOJI && // the first two candlesticks are not doji
         cand2.open<cand1.close && // a gap between the first and the second
         cand3.open<cand2.open && cand3.open>cand2.close && cand3.close>cand2.open && cand3.close<cand1.close) // 3rd candlestick opens inside 2nd and closes inside the gap
        {
         comment=_language?"Downside Tasuki Gap";
         if(!_forex)// non-forex
           {
            DrawSignal(prefix+"Downside Tasuki Gap the bull model"+string(objcount++),cand1,cand2,cand3,InpColorBear,comment);
           }
        }

3.2.4. Motifs composés de quatre chandeliers

Nom du Motif Ordre Motif classique Forex Identification du motif
Frappe à trois lignes
(haussier)

Achat

 La tendance haussière se poursuit avec trois chandeliers, similaires au motif des Trois soldats blancs : de longs chandeliers blancs avec des ombres courtes.
 Forex : Les prix d'ouverture/de clôture des chandeliers blancs sont identiques.
 Le quatrième chandelier s'ouvre avec un écart vers le haut et clôture en dessous de l'ouverture du premier chandelier blanc.
 Forex : clôture du 3ème et ouverture du 4ème chandeliers égaux.
Une confirmation est suggérée.
Frappe à trois lignes (baissière)

vente

 La tendance baissière se poursuit avec trois chandeliers, similaires au motif des trois corbeaux noirs : de longs chandeliers noirs avec des ombres courtes.
 Forex : Les prix d'ouverture/de clôture des chandeliers noirs sont les mêmes (similaires aux trois corbeaux identiques).
 Le quatrième chandelier s'ouvre avec un écart vers le bas et clôture au-dessus de l'ouverture du premier chandelier noir.
 Forex : clôture du 3ème et ouverture du 4ème chandeliers sont égales.
Une confirmation est suggérée.

      //------      
      // Three-line strike the bull model
      if(cand1.trend==UPPER && cand1.bull && cand2.bull && cand3.bull && !cand4.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && // check the "long: candlestick or "maruozu"
         (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && //  check the "long: candlestick or "maruozu"
         cand2.close>cand1.close && cand3.close>cand2.close && cand4.close<cand1.open) // close of 2nd is higher than 1st, that of 3rd is higher than 2nd, the fourth candlestick closes lower than the 1st
        {
         comment=_language?"Three-line strike";
         if(_forex)// if forex
           {
            if(cand4.open>=cand3.close) // 4th opens higher than the 3rd
              {
               DrawSignal(prefix+"Three-line strike the bull model"+string(objcount++),cand1,cand3,cand4,InpColorBull,comment);
              }
           }
         else // a different market
           {
            if(cand4.open>cand3.close) // 4th opens higher than th 3rd
              {
               DrawSignal(prefix+"Three-line strike the bull model"+string(objcount++),cand1,cand3,cand4,InpColorBull,comment);
              }
           }
        }
      //------      
      // Three-line strike the bear model 
      if(cand1.trend==DOWN && !cand1.bull && !cand2.bull && !cand3.bull && cand4.bull && // check the trend direction and direction of the candlestick
         (cand1.type==CAND_LONG || cand1.type==CAND_MARIBOZU_LONG) && (cand2.type==CAND_LONG || cand2.type==CAND_MARIBOZU_LONG) && //  check the "long: candlestick or "maruozu"
         (cand3.type==CAND_LONG || cand3.type==CAND_MARIBOZU_LONG) && //  check the "long: candlestick or "maruozu"
         cand2.close<cand1.close && cand3.close<cand2.close && cand4.close>cand1.open) // close of 2nd is lower than 1st, close of 3rd is lower than 2nd, the fourth candlestick closes higher than 1st
        {
         comment=_language?"Three-line strike";
         if(_forex)// if forex
           {
            if(cand4.open<=cand3.close) // the fourth opens lower than or equal to the third
              {
               DrawSignal(prefix+"Three-line strike the bear model"+string(objcount++),cand1,cand3,cand4,InpColorBear,comment);
              }
           }
         else // a different market
           {
            if(cand4.open<cand3.close) // the fourth opens lower than 3rd
              {
               DrawSignal(prefix+"Three-line strike the bear model"+string(objcount++),cand1,cand3,cand4,InpColorBear,comment);
              }
           }
        }

4. L’implémentation de l'indicateur

Sélectionnons les paramètres d'entrée requis.

Paramètres d'entrée de l'indicateur Candlestick Patterns

Figure 3. Paramètres d'entrée de l'indicateur Motifs de Chandeliers

Le premier paramètre est la "période de calcul de la moyenne" - nous en avons besoin pour déterminer la direction de la tendance, définir les chandeliers "longs" et "courts".

Le paramètre suivant est "Activer le signal" - responsable de l'activation/désactivation du signal. Le signal indique qu'un nouveau motif est apparu.

Signaux générés par l'indicateur Motifs des Chandeliers

Figure 4. Signaux générés par l'indicateur Motifs de Chandelier

Le paramètre "Nombre de barres pour le calcul" est conçu pour simplifier le travail de l'indicateur. Si sa valeur est inférieure ou égale à 0, les modèles de chandeliers sont recherchés dans tout l'historique disponible, sinon un nombre défini de barres est utilisé pour la recherche, ce qui simplifie considérablement le travail de l'indicateur.

Je pense que tout est clair avec les couleurs...

« Activer les commentaires » signifie activer/désactiver les noms des modèles de chandeliers.

"Taille de la police" définit la taille de la police pour les commentaires.

L’implémentation de l'indicateur est très simple.

Attendez-vous à l'apparition d'un nouveau bar :

//--- Wait for a new bar
   if(rates_total==prev_calculated)
     {
      return(rates_total);
     }

Ensuite, nous calculons la valeur initiale du compteur pour démarrer le cycle.

   int limit;
   if(prev_calculated==0)
     {
      if(InpCountBars<=0 || InpCountBars>=rates_total)
         limit=InpPeriodSMA*2;
      else
         limit=rates_total-InpCountBars;
     }
   else
      limit=prev_calculated-1;

Dans la boucle, nous vérifions les combinaisons de chandeliers et les affichons comme l’indique la Fig. 5:

  • Combinaison avec un chandelier : une flèche avec le nom du motif au-dessus ou en dessous.
  • Combinaison avec deux chandeliers : un rectangle fin avec le nom du motif au-dessus ou au-dessous du premier chandelier.
  • Combinaison avec trois chandeliers ou plus : un rectangle épais avec le nom du motif au-dessus ou au-dessous du dernier chandelier.

Exemple de fonctionnement de l'indicateur Motifs de Chandelier

Figure 5. Exemple de fonctionnement de l'indicateur Motifs de Chandelier

Veuillez noter qu'en raison de la possibilité de surcharge des fonctions, la sortie des signes de différents modèles se fait via les fonctions portant le même nom DrawSignal(), mais avec des nombres de paramètres différents.

void DrawSignal(string objname,CANDLE_STRUCTURE &cand,color Col,string comment)
void DrawSignal(string objname,CANDLE_STRUCTURE &cand1,CANDLE_STRUCTURE &cand2,color Col,string comment)
void DrawSignal(string objname,CANDLE_STRUCTURE &cand1,CANDLE_STRUCTURE &cand2,CANDLE_STRUCTURE &cand3,color Col,string comment)

Le texte intégral de l'indicateur se trouve dans le fichier Candlestick_Patterns.mq5 joint à cet article.

Conclusion

Dans cet article, nous avons passé en revue la plupart des modèles de chandeliers, les méthodes de détection et fourni des exemples sur la façon de les implémenter dans le langage de programmation MQL5. La pièce jointe à l'article contient deux indicateurs et un fichier d'inclusion. Pour les utiliser, placez les indicateurs dans le dossier \Indicators et incluez le fichier dans le dossier \Include, puis compilez-les.

J'espère que l'analyse des modèles de chandeliers vous aidera à améliorer les résultats de votre travail.

Pour l'avenir, j'aimerais ajouter que les chandeliers filtrés donnent de meilleurs résultats que la plupart des indicateurs techniques, mais nous examinerons ce sujet dans l'article suivant, dans lequel je vais créer un système de trading et un Expert Advisor trading par le modèles de chandeliers.

Traduit du russe par MetaQuotes Ltd.
Article original : https://www.mql5.com/ru/articles/101

Création d’un Expert Advisor, qui trade sur un certain nombre d’instruments Création d’un Expert Advisor, qui trade sur un certain nombre d’instruments
Le concept de diversification des actifs sur les marchés financiers est vieux et a toujours attiré les traders débutants. Dans cet article, l’auteur propose une approche extrêmement simple d’une élaboration d’un Expert Advisor multi-devises, pour une première introduction à cette direction des stratégies de trading.
Guide d'écriture d'une DLL pour MQL5 en Delphi Guide d'écriture d'une DLL pour MQL5 en Delphi
L'article examine le mécanisme de création d'un module DLL, en utilisant le langage de programmation populaire d' ObjectPascal, dans un environnement de programmation Delphi. La documentation, fournie dans cet article, est conçue pour cibler principalement les programmeurs débutants, qui travaillent avec des problèmes, qui dépassent les limites du langage de programmation intégré de MQL5, en connectant les modules DLL externes.
Tester la performance du Calcul des Moyennes Mobiles dans MQL5 Tester la performance du Calcul des Moyennes Mobiles dans MQL5
Un certain nombre d'indicateurs sont apparus depuis la création du premier indicateur de Moyenne Mobile. Beaucoup d'entre eux utilisent des méthodes de lissage similaires, mais la performance de différents algorithmes de Moyennes Mobiles n'ont pas été étudiées. Dans cet article, nous examinerons les différentes manières d'utiliser les Moyennes Mobiles dans MQL5 et comparerons leurs performance.
Un exemple de système de trading axé sur un indicateur Heiken-Ashi Un exemple de système de trading axé sur un indicateur Heiken-Ashi
Dans cet article, nous examinons la question de l'utilisation d'un indicateur Heiken-Ashi dans le trading. Sur la base de cet indicateur, un système de trading simple est considéré et un conseiller expert MQL5 est écrit. Les opérations de trading sont implémentées sur les bases de classes de la bibliothèque de classes Standard. Les résultats des tests de la stratégie de trading examinée, sont basés sur l'historique et obtenus à l'aide du testeur de stratégie MetaTrader 5 intégré, sont fournis dans l'article.