English Русский 中文 Español Deutsch Português 한국어 Français Italiano Türkçe
ろうそく足パターンの分析

ろうそく足パターンの分析

MetaTrader 5トレーディングシステム | 6 10月 2015, 12:45
9 318 0
Dmitry Voronkov
Dmitry Voronkov


はじめに

ろうそく足チャートのプロットとろうそく足パターンの分析は技術分析のすばらしい手法です。ろうそく足の利点はデータ内部の勢いをみることができるデータ表現になっていることです。

ろうそく足はトレードのいきいきとしたイメージを見せてくれます。本稿を読み、少しばかり練習をしたら、ろうそく足はみなさんの分析手法の一部となっていることでしょう。日本式のろうそく足チャートでファイナンシャル市場の「内側」をえぐることができます。それは他のグラフ手法ではとてもむつかしいことです。 それらは等しくすべてのマーケットにふさわしいものです。


1. ろうそく足タイプ

過去の価格から将来の価格変動の予言を始めた分析の第一人者の一人は伝説の日本人、本間宗久氏です。米相場のトレードに本間氏が取り入れたトレーディングの基本は日本式ろうそく足手法のさきがけでした。うそく足手法は今日、日本内外で広く利用されているものです。

ろうそく足の構造

図1 ろうそく足の構造

ろうそく足の構造について考察します。(図1)始値と終値の差を表す長方形はろうそく足の実体と呼ばれます。実体の高さはトレーディング期間の始値と終値の範囲を表します。終値が始値より高ければ、ろうそく足実体色は白です。(図1)実体が黒(図1b)ならば終値が始値を下回ったということです。

ろうそく足には上側と下側にヒゲがあります。ヒゲの長さは始値/終値の間の距離および安値/高値に依存します。

ろうそく足はチャートに一つずつプロットされ、様々なパターンを描きます。 理論によると、トレンドが変動する可能性を示すパターンもあります。また、トレンドを確認するパターン、市場が煮え切らないことを示すパターンもあります。

ろうそく足の実体が長いものは、一般に買い手または売り手からのプレッシャーを伝えます。(ろうそく足の色によります。)実体が短いものは、上げ相場と下げ相場間の葛藤が弱いことを表します。

ろうそく足 内容
/td> "Long Candlesticks" 長いろうそく足への関連は日本式 ろうそく足の文献で広く知られています。
「長い」という言葉はろうそく足実体を意味し、始値と終値の差です。
何が長くて何が長くないか判断するには最近の価格変動を考察するのが良い方法です。
5~10日前、というのが正しい結論に達する適切な期間です。
/td> "Short Candlesticks" 短いろうそく足を判断するのは長い ろうそく足と同じ方法です。そして似た結果を提示します。
また、前述の2つに分類されないろうそく足も多くあります。
"Marubozu" 日本語で『丸坊主』とはほとんど禿のことです。
いずれにせよ、この言葉はろうそく足の実体上下ともにヒゲのない、またはヒゲがあってもたいへん短いことを意味しています。

黒丸坊主は片側にヒゲのない長い黒い実体です。それは弱気継続パターン、または強気逆転パターンであることが多く、特にダウントレンドに出現します。 長い黒色のろうそく足は強気の大勝利を示します。よってそれはしばしば, 強気特色の多くの逆転パターンの初日に出現します。

白丸坊主は片側に影のない長い白い実体です。これは相場の勢いがひじょうに強いろうそくです。黒丸坊主と違い、しばしば継続の強気相場パターンか弱気逆転パターンで終わります。
"Doji". ろうそく足の実体が小さいため、始値と終値が同じであればそれは「同時線」と呼ばれます。
始値と終値の要求が全く同じであり、データに厳しい制約が設けられるので、同時線はほとんど見られません。
始値と終値の差が数個のティック(最小価格変動)を超えることがなければ、これは十分以上です。
"Spinning Tops"は実体よりも上下のヒゲが長い短いろうそく足です。
「白」と「黒」の同時線を表します。コマは強気相場と弱気相場の迷いを示します。
ヒゲの長さ同様、コマの実体色は重要ではありません。ヒゲのわりに小さな実体はコマを形成するものです。
/td> "Hanging man"と"Hammer"これは実体が小さく下側に長いヒゲのあるろうそく足です。実体は価格範囲の一番上に位置します。
こういったろうそく足の驚く特徴は出現するトレンドフェーズに応じて強気相場であり弱気相場でありえることです。
下降傾向におけるこれらろうそくの出現はそれの市場における優勢が終わりに近づいているシグナルです。この場合 ろうそく足は「ハマー」と呼ばれます。
ろうそく足が上昇傾向に出現したら、終わりの可能性を示し、そのろうそく足には不吉な名前がついています。「ハングマン」です。
"A star"は、前の長い実体から次に出現する小さい実体が高寄りまたは安寄りする時はいつも小さい実体が出現するときの状態を言います。実体の色は重要ではありません。
理想的には隙間にはヒゲもあることですが、必ずというわけではありません。星は市場における不確定な優勢を示します。
星は多くのろうそく足パターンに含まれます。多くの場合逆転です。

表1 ろうそく足タイプ

個別のろうそく足はろうそく足sの組合せを分析するのにきわめて重要です。分析者が別々にそれらを使い、他のろうそく足と組わ合せることで、 市場心理状態が明らかになります。


2. ろうそく足の基本タイプ特定

2.1. 必要な構造

ろうそく足パターンは個別のろうそく足である場合と数個を含む場合があります。ろうそく足パターンについては、認識に一定のルールがあります。

例:Evening star(弱気相場パターン)上向きトレンド一番目と三番目のろうそく足が「長い」。星のヒゲは短く、色は関係ありません。一般的パターン:第一のろうそく足の終値から星が離れている。外為用、またその日以内:第一のろうそく足の終値と星の始値が等しくなっています。三番目のろうそく足は一番目より短くその範囲に収まっています。

まずろうそく足タイプを認識することを学びます。このため、RecognizeCandle関数を書きます。これはろうそく足タイプを認識し必要な情報を返します。

//+------------------------------------------------------------------+
//|   Function of candlestick type recognition                       |
//+------------------------------------------------------------------+
bool RecognizeCandle(string symbol,ENUM_TIMEFRAMES period, datetime time,int aver_period,CANDLE_STRUCTURE &res)
そこでは
  • symbol - シンボル名
  • period – チャート期間
  • time – ろうそく足のオープン時刻
  • aver_period - 平均化期間
  • res - 結果が返されるストラクチャ

ろうそく足 パターンの認識を基にどんな結果が必要なのか定義します。

  • オープン、クローズ、高、低
  • ろうそく足の開始時刻
  • トレンド方向
  • 強気相場または弱気相場ろうそく足
  • ろうそく足実体サイズ – 絶対値
  • ろうそく足タイプ(表1より)

ストラクチャを作成します。

//+------------------------------------------------------------------+
//| 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
  };

トレンドとタイプが数字タイプの変数であるところで

//+------------------------------------------------------------------+
//|   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
  }; 

RecognizeCandle関数を考察します。

2.2. ろうそく足タイプの認識

//+------------------------------------------------------------------+
//| 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);
     }

まずCopyRates関数を使い以前のaver_period +1 ろうそく足からデータを取得します。取得した配列にデータを保存する順序に注意します。

エラーなくデータを取得したら戻しストラクチャ、CANDLE_STRUCTUREにデータを書き始めます。

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;

トレンドの定義トレンドとは?この質問に対する完璧な答えがあったら、マーケットの謎は解けていることでしょう。本稿では、移動平均を使ってトレンドを判断する手法を用います。

MA=(C1+C2+…+Cn)/N,
ここで、C – 終値、N – バー数

L. Morrisの著書で"Candlestick Charticng Explained. Timeless techniques for Trading Stocks and Futures" は、短期傾向を特定するため10の期間で移動平均を使っています。終値が平均を上回る場合、トレンドは上向き、下回れば下向きです。

記述すると以下です。

//--- 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;

次に われわれのろうそくは強気相場 か弱気相場か明確にし、ろうそく足実体の絶対値、ヒゲのサイズ、aver_period中の ろうそく足の実体平均サイズ 、その他必要な中間データを計算します。

//--- 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;

ろうそく足タイプの特定についてみます。

2.3. ろうそく足タイプ特定のルール

"Long" ろうそく足 「長い」ろうそく足を定義するにはaver_periodの以前のろうそくの平均値に対して現在のろうそく足値を確認します。

(実体) > (過去5日間の実体平均) *1.3

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

"Short" ろうそく足「短い」ろうそく足を定義するには、「長い」ものと同じ原理を使いますが、条件は異なります。

(実体) > (過去 X 日間の実体平均) *0.5

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

Doji同時線は始値と終値が等しい時に起こります。これは厳然としたルールです。ほとんどのデータタイプでは、パターンを見つけるのに多少の狂いはおおめに見ます。その式により、許容限界の2つの価格の間のパーセンテージ差を見つけることができます。

(同時線実体) < (高値と安値の範囲) * 0.03

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

"Marubozu" これは高いも低いもなくひじょうに小さろうそく足です。

(下ヒゲ) < (実体) * 0.03 または (上ヒゲ) < (実体) * 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;
     }

本稿のインディケータを書くとき、「長い」ろうそく足のチェックについて条件を追加する「長い」「丸坊主」は分離する必要がありました。

"Hammer""Hanging Man"。実体は日時範囲の上部に位置し、下ヒゲは実体よりもずっと長くなっています。 上ヒゲがあれば、その長さについて考慮することも必要です。実体と下ヒゲの割合は下ヒゲに対する実体長として定義します。

(下ヒゲ)>(実体)*2 および (上ヒゲ)< (実体)*0.1

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

"Shooting Star""Inverted Hammer"は「ハマー」に似ていますが、反対の条件です。

(下ヒゲ)<(body)*0.1また(上ヒゲ)> (body)*2

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

"Spinning Tops"これらは実体よりもヒゲがある 「短い」 ろうそく足です。

(下ヒゲ) > (実体) また(上ヒゲ) > (実体)

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

関数のソーステキストとストラクチャ記述は添付ファイルろうそく足Typemqhにあります。

また、本稿にろうそく足 タイプColor.mq5 インディケータが添付されています。それはチャート上でタイプによってろうそく足を色づけします。

図2 ろうそく足タイプColor.mq5の例

これで必要なデータをすべて返す関数を作成しました。

これからろうそく足パターンを認識するインディケータの作成に進むことができます。


3. ろうそく足パターンと認識のためのアルゴリズム

ろうそく足パターンは単独のろうそく足、数個のろうそく足から構成されている場合があります。ごくまれに5~6個の場合もあります。日本の文献には、もっと多くの数のろうそく足から構成されているパターンもときどき見受けられます。パターンを考察する順番は重要性や予測の可能性に反映しません。

ろうそく足パターンは2タイプに分かれます - 逆転パターン継続パターンです。

まずシンプルパターン(一つのろうそく足)から考察し、複雑パターン(数個のろうそく足)に移っていきます。そのパターンを含む図は2本の小さな垂直線から開始します。これらの線は単純に前の市場傾向方向を示します。そしてパターン間の直接方向として使用されることはありません。

パターンは表に表されます。最初の線では強気相場パターンを、次の線ではそれがある場合、逆の弱気相場パターンを表します。

3.1. ろうそく足の逆転パターン

3.1.1. 単一のろうそく足を構成するパターン

単一ろうそく足データを取得します。

//--- 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 */

そしてパターンを認識します。

パターン名 順序 分類パターン 外為 パターン認識
逆転
hammer
(強気相場)

買い

下降傾向
上ヒゲは2以下ではなく実体より3倍以上長くない。
下ヒゲはない、またはひじょうに短い。(ろうそく足範囲の10%以上ではない。)
ロングゲームの実体色は重要ではない。ショートゲームに関しては、白色ハマーは黒色ハマーよりずっと強い。
確認することを提案します。

Hanging Man
(弱気相場)

売り

上昇傾向
下ヒゲは2以下ではなく実体の3倍以上長くない。
上ヒゲなない、またはひじょうに短い。(ろうそく足範囲の10%以上ではない。)
ロングゲームの実体色は重要ではない。ショートゲームでは黒色ハマーは白色ハマーよりずっと強い。
確認することを提案します。
//------      
      // 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);
        }
パターン名 順序 分類パターン 外為 パターン認識
Hammer
(強気相場)

買い

下降傾向
下ヒゲは2以下ではなく実体の3倍以上長くない。
上ヒゲなない、またはひじょうに短い。(ろうそく足範囲の10%以上ではない。)
ロングゲームの実体色は重要ではない。ショートゲームに関しては、白色ハマーは黒色ハマーよりずっと強い。
確認することを提案します。
Shooting Star
Shooting Star(弱気相場)

売り

上昇傾向
上ヒゲは3以下ではなく実体より大い。
下ヒゲはない、またはひじょうに短い。(ろうそく足範囲の10%以上ではない。)
星と以前のろうそく足間の価格差
外為:前のろうそく足の終値と星の始値が等しい。
実体色は関係ありません。確認することを提案します。
//------      
      // 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);
              }
           }
        }

「流れ星」の場合、2つろうそく足が必要だということに注意が必要です。パターンを認識する上で前日の実体も含めて考えられるからです。

パターン名 順序 分類パターン 外為 パターン認識
Belt Hold
(強気相場)

買い

パターンは
該当
ありません。
下降傾向
トレンド方向に大差があるろうそく足のオープン
白ろうそく足 — «marubozu» «long»
白いろうそく足の実体は前のろうそく足の実体よりもずっと大きくなっています。
確認することを提案します。
Belt Hold
(弱気相場)

売り

パターンは
該当
ありません。
上昇傾向
トレンド方向に大差があるろうそく足のオープン
黒ろうそく足 — «marubozu» «long»
黒いろうそく足の実体は前のろうそく足の実体よりもずっと大きくなっています。
確認することを提案します。
//------      
      // 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);
           }
        }

"Shooting Star"の場合同様、2つろうそく足が使用されます。パターンを認識するには前日の実体も含めます。

3.1.2. 2つのろうそく足を構成するパターン

別のろうそくを追加します。

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

そしてパターンを認識します。

パターン名 順序 分類パターン 外為 パターン認識
Engulfing
(強気相場)

買い

下降傾向
二番目のろうそく足実体は一番目より完全に長くなっています。
外為:黒いろうそく足の終値と白の始値が等しい。
ヒゲは関係ありません。
確認することを提案します。

Engulfing
(弱気相場)

売り

上昇傾向
二番目のろうそく足実体は一番目より完全に長くなっています。
外為:白いろうそく足の終値と黒の始値が等しい。
ヒゲは関係ありません。
確認することを提案します。

//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Harami Cross (強気相場)

買い

下降傾向
最初のパターンのろうそく足は長い黒です。
同時線はヒゲを含み最初のろうそく足範囲内で短くなっています。
外為:同時線は最初のろうそく足の終値レベルにあります。同時線のヒゲが短い場合は、外為パターンのDoji Starとみなされます。
確認することを提案します。

Harami Cross
(弱気相場)

売り

上昇傾向
最初のパターンのろうそく足は長い白です。
同時線はヒゲを含み最初のろうそく足範囲内で短くなっています。
外為:同時線は最初のろうそく足の終値レベルにあります。同時線のヒゲが短い場合は、外為パターンのDoji Starとみなされます。
確認することを提案します。
//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Harami
(強気相場)

買い

下降傾向
一番目の「長い」ろうそく足実体は二番目より完全に長くなっています。
ヒゲは関係ありません。
外為:黒いろうそく足の終値と白の始値が一致します。
確認することを提案します。

Harami
(弱気相場)

売り

上昇傾向
一番目の「長い」ろうそく足実体は二番目より完全に長くなっています。
ヒゲは関係ありません。
外為:色いろうそく足の終値と黒の始値が一致します。
確認することを提案します。
//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Doji Star
(強気相場)

買い

下降傾向
最初のパターンのろうそく足は長い黒です。
二番目のセッション - トレンド方向のブレークがある同時線
外為:ブレークなし
同時線のヒゲは短くなっています。
確認することを提案します。

Doji Star
(弱気相場)

売り

上昇傾向
最初のパターンのろうそく足は長い白です。
二番目のセッション - トレンド方向のブレークがある同時線
外為:ブレークなし
同時線のヒゲは短くなっています。
確認することを提案します。
//------      
      // 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);

              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Piercing Pattern
(強気相場)

買い

下降傾向
どちらのろうそく足も長くなっています。
白いろうそく足の始値は黒の安値を下回わります。
外為:黒いろうそく足の終値と白の始値が等しい。
白のろうそく足は黒の範囲内でそれより短く、実体の50%以上はあります。(株式市場に対して:Dark Cloud Coverとは異なり、この要求には例外がありません。)
従来のモデルには確認は要求されません。確認は外為に対して要求されます。
Dark Cloud Cover (弱気相場)

売り

上昇傾向
どちらのろうそく足も長くなっています。
黒の ろうそく足の始値は白のろうそく足の高値を上回ります。
外為:色いろうそく足の終値と黒の始値は等しくなっています。
黒のろうそく足は白の長さの範囲内でそれより短く、実体の50%以上はあります。
従来のモデルには確認は要求されません。確認は外為に対して要求されます。
//------      
            // 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);
                     
                    }
                 }
              }
パターン名 順序 分類パターン 外為 パターン認識
Meeting Lines
(強気相場)

買い

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は長い黒です。
白いろうそく足の始値は大きな差をつけて黒の安値を下回ります。
どちらの ろうそく足の終値も等しくなっています。
白いろうそく足の実体は黒のろうそく足の実体よりも大きくなっています。
確認することを提案します。
Meeting Lines
(弱気相場)

売り

パターンは
該当
ありません。
上昇傾向
最初のパターンのろうそく足は長い白です。
黒いろうそく足の始値は大きく白の高値を上回ります。
どちらの ろうそく足の終値も等しくなっています。
黒いろうそく足の実体は白のろうそく足の実体よりも大きくなっています。
確認することを提案します。
// 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);
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Matching Low
(強気相場)

買い

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は必ずしも長い必要はありません。
二番目のろうそく足の始値は一番目より下にあります。どちらの ろうそく足の終値も等しくなっています。
下ヒゲなない、またはひじょうに短くなっています。
確認することを提案します。
//------      
      // 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);
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Homing Pigeon<br1(bullish)
Bullish Homing Pigeon

買い

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は必ずしも長い必要はありません。
二番目のろうそく足の始値は一番目より下にあります。どちらの ろうそく足の終値も等しくなっています。
下ヒゲなない、またはひじょうに短くなっています。
確認することを提案します。
      //------      
      // 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. 3つのろうそく足で構成されるパターン

/* Checking patterns with three candlesticks */
      CANDLE_STRUCTURE cand3;
      cand3=cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-2],InpPeriodSMA,cand1))
         continue;
パターン名 順序 分類パターン 外為 パターン認識
Abandoned Baby
(強気相場)

買い

パターンは
該当
されません。

これは滅多にない重要な逆転パターンです。
下降傾向
最初のパターンのろうそく足は長い黒です。
二番目のろうそく足は隣のろうそく足との間に差を伴う同時線で、その差はろうそく足の実体間にのみあるのでななくヒゲにもおよびます。
三番目のろうそく足はヒゲの間に同じ隙間のある「長い」白のろうそく足で、一番目より短くなっています。

Abandoned Baby
(弱気相場)

売り

パターンは
該当
されません。

これは滅多にない重要な逆転パターンです。
上昇傾向
最初のパターンのろうそく足は長い白です。
二番目のろうそく足は隣のろうそく足との間に差を伴う同時線で、その差はろうそく足の実体間にのみあるのでななくヒゲにもおよびます。
三番目のろうそく足はヒゲの間に同じ差のある「長い」黒のろうそく足で、一番目よりも短くなっています。

      //------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Morning Star
(強気相場)

買い

下降傾向
一番目と三番目のセッションは「長い」ろうそく足です。星のヒゲは短く、色は関係ありません。最初のろうそく足の終値から星は離れています。
外為:前のろうそく足の終値と星の始値が等しくなっています。
三番目のろうそく足は一番目より短くその長さの内側に収まっています。
Evening Star
(弱気相場
)

売り

上昇傾向
一番目と三番目のセッションは「長い」ろうそく足です。星のヒゲは短く、色は関係ありません。最初のろうそく足の終値から星は離れています。
外為:前のろうそく足の終値と星の始値が等しくなっています。
三番目のろうそく足は一番目より短くその範囲に収まっています。
// 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Morning Doji Star
(強気相場)

買い

下降傾向
最初のパターンのろうそく足は長い黒です。
二番目のセッション - トレンド方向のブレークがある同時線
外為:ブレークなし
同時線のヒゲは短くなっています。
三番目のろうそく足は一番目より短くその長さの内側に収まっています。
Evening Doji Star
(弱気相場)

売り

上昇傾向
最初のパターンのろうそく足は長い白です。
二番目のセッション - トレンド方向のブレークがある同時線
外為:ブレークなし
同時線のヒゲは短くなっています。
確認することを提案します。
//------      
      // 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.candlestickcandlestickis 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Bearish Upside Gap Two Crows

売り

パターンは
該当
ありません。
上昇傾向
最初のろうそく足は長い白です。
白と黒のろうそく足間の差
三番目のろうそく足の始値は二番目よりも高く、二番目の長さは三番目の長さの範囲内でそれより短くなっています。確認することを提案します。パターンの意味:価格が4番目のセッションの間上がらなければ、 価格は下がると予想する必要があります。
Two Crows
(弱気相場)

売り

パターンは
該当
ありません。
上昇傾向
最初のパターンのろうそく足は長い白です。
白と一番目の黒のろうそく足間に差があります。
三番目のろうそく足は黒で「長い」必要があります。始値は二番目のそれより低いか高いかで、白のろうそく足の長さ範囲内または追いつくように下でクローズします。
確認することを提案します。二番目のcrow(三番目のろうそく)が白のろうそくを抱き込む長さであれば、確認は必要ありません。
//------      
      // 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);
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Three Star in the South
(強気相場)

買い

下降傾向
最初のろうそく足は下ヒゲの長い、長い黒い実体です。二番目のろうそく足が一番目より短く、その安値は一番目の安値を上回ります。
三番目のろうそく足は小さい黒の丸坊主または星で二番目のセッションに関連する内部日です。
確認することを提案します。
Deliberation
(弱気相場)

売り

上昇傾向
高い終値の3つの白いろうそく足最初の2つのろうそく足 は長くなっています。
それぞれのろうそく足の始値は前の実体にかぶさっています。
外為:白いろうそく足の始値/終値は等しくなっています。
三番目のろうそく足の始値は二番目のろうそく足の終値レベルです。三番目のろうそく足は星またはコマです。
確認することを提案します。
//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Three White Soldiers
(強気相場)

買い

下降傾向
3つの長い白の ろうそく足が次々と現れ、それぞれの終値は前の終値より高くなっています。
各ろうそく足の始値は前のろうそく足実体にかぶさっています。
外為:ろうそく足の終値と始値が等しい。
ろうそく足の上ヒゲは短い。
確認は必要ありません。
Three Black Crows
(弱気相場)

売り

パターンは
該当
ありません。
上昇傾向
3つの長い黒の ろうそく足が次々と現れ、それぞれの終値は前の終値より低くなっています。
各ろうそく足の始値は前のろうそく足実体にかぶさっています。
外為:3つのろうそく足に似通ったパターンを示します。
ろうそく足の下ヒゲは短くなっています。
確認は必要ありません。
//------      
      // 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);
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Three Outside Up
(強気相場)

買い

下降傾向
最初にEngulfing(強気相場)のパターンが形成されます。二番目のろうそく足実体は一番目の実体サイズを完全に飲み込む形になります。
外為:黒いろうそく足の終値と白の始値が等しくなります。
ヒゲは関係ありません。
そして三日目により高い終値となります。
確認は必要ありません。パターンそのものが強気Engulfingに対する確認です。
Three Outside Down
(弱気相場)

売り

上昇傾向
最初にEngulfing(弱気相場)のパターンが形成されます。二番目のろうそく足実体は一番目の実体サイズを完全に飲み込んだ形になります。
外為:白いろうそく足の終値と最初の黒の始値が一致します。
ヒゲは関係ありません。
そして三日目により低い終値となります。
確認は必要ありません。パターンそのものが弱気Engulfingに対する確認です。
//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Three Inside Up
(強気相場)

買い

下降傾向
最初の2つのセッションでは、Harami (強気相場)パターンが形成されます。小さな白の実体が大きい黒の実体範囲に収まる形になります。三番目のセッションの終値は最初の2つのろうそく足の高値よりも高くなります。
確認は必要ありません。パターンそのものが強気Haramiに対する確認です。
Three Inside Down
(弱気相場)

売り

上昇傾向
最初の2つのセッションでは、Harami(弱気相場)パターンが形成されます。小さな黒の実体が大きい白の実体のサイズに収まる形になります。三番目のセッションの終値は最初の2つのろうそく足安値よりも低くなります。
確認は必要ありません。パターンそのものが弱気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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Three Stars
(強気相場)

買い

下降傾向
最初の同時線とその前のろうそく足は離れている必要はありません。
3つのろうそく足はすべて同時線です。
真ん中の同時線には上か下に差があります。
外為:3つの同時線はすべて同レベルです。
確認することを提案します。
Three Stars
(弱気相場)

売り

上昇傾向
最初の同時線とその前のろうそく足は離れている必要はありません。
3つのろうそく足はすべて同時線です。
真ん中の同時線には上か下に差があります。
外為:3つの同時線はすべて同レベルです。
確認することを提案します。
//------      
      // 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Identical Three Crows
(弱気相場)

売り

上昇傾向
3つの長い黒の ろうそく足が次々と現れ、それぞれの終値は前の終値より低くなっています。
各ろうそく足の始値はだいたい前のろうそく足の終値に等しくなっています。。
ろうそく足の下ヒゲは短くなっています。<br4/>確認は必要ありません。
// 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);
              }
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Unique Three River Bottom
(強気相場)

買い

パターンは
該当
ありません。
下降傾向
最初のモデルのろうそく足は短いヒゲの長い黒です。
二日目にハラミが出現しますが、黒の実体です。
二日目のより短いヒゲが新たな安値です。
そして三日目に中日より低い短い白となります。
確認は必要ありませんがする方がよいです。
      // 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" candlestickor "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. 4つのろうそく足を構成するパターン

/* Checking patterns with four candlesticks */      
      CANDLE_STRUCTURE cand4;
      cand4=cand3;
      cand3=cand2;
      cand2=cand1;
      if(!RecognizeCandle(_Symbol,_Period,time[i-3],InpPeriodSMA,cand1))
         continue
パターン名 順序 分類パターン 外為 パターン認識
Concealing Baby Swallow (bull)

買い

パターンは
該当
ありません。
下降傾向
最初の2つのセッションは2つの黒い丸坊主です。
三番目のセッションはブレークダウンでオープンしますが、取引は二番目のろうそく足長さ範囲内で形作られます。それは長い上ヒゲを形成します。
4番目の黒い ろうそく足はヒゲを含み完全に三番目を抱き込む形になります。
確認は必要ありません。
//------      
      // 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. 2つのろうそく足を構成するパターン

/* 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
パターン名 順序 分類パターン 外為 パターン認識
Breakaway
(強気相場)

買い

パターンは
該当
ありません。
下降傾向
最初の2つのセッションは「長い」黒のろうそく足と間に大きな差を伴う「短い」黒の ろうそく足 (星)です。
三番目のセッションは「短かく」、色は問いません。
四番目のろうそく足 は「短い」黒です。
五番目は差にクローズがくる「長い」白です。
確認することを提案します。
Breakaway
(弱気相場)

売り

パターンは
該当
ありません。
上昇傾向
最初の2つのセッションは「長い」白のろうそく足と間に差がある「短い」白の ろうそく足 (星)です。
三番目のセッションは「短かく」、色は問いません。
四番目のろうそく足 は「短い」白です。
五番目は差にクローズがくる「長い」黒です。
確認することを提案します。
      //------      
      // 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. 継続パターン

継続パターンは市場が休んでいるときです。

モデルがなにであっても、現ポジションについて判断をする必要があります。たとえそれで何も変わらなくてもです。

3.2.1. 単独のろうそく足を構成するパターン

パターン名 順序 分類パターン 外為 パターン認識
Kicking
(強気相場)

買い

パターンは
該当
ありません。
黒の『丸坊主』に白の『丸坊主』が続きます。
実体の間に差があります。
確認は必要ありません。
Kicking
(弱気相場)

売り

パターンは
該当
ありません。
白の「丸坊主」に続き、黒の「丸坊主」がきます。
実体の間に差があります。
確認は必要ありません。
//------      
      // 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. 2つのろうそく足を構成するパターン

パターン名 順序 分類パターン 外為 パターン認識
Bearish On Neck Line

売り

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は長い黒です。
白のろうそく足は黒の安値の下でクローズし、黒は黒のろうそく足の安値あたりでクローズします。
白のろうそく足 - ロング・デイである必要はありません。
確認することを提案します。
In Neck Line
(弱気相場)

売り

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は長い黒です。
白のろうそく足は黒の安値の下でクローズし、黒は黒のろうそく足の終値よりやや高くでクローズします。
白のろうそく足 - ロング・デイである必要はありません。
白いろうそく足の実体は黒のろうそく足の実体よりも小さくなっています。
白いろうそく足の上ヒゲはひじょうに短くなっています。
確認することを提案します。
Thrustingライン
(弱気相場)

売り

パターンは
該当
ありません。
下降傾向
最初のパターンのろうそく足は長い黒です。
白のろうそく足は黒の安値の下でオープンし、黒のろうそく足の終値より高くクローズしますが終値はまだ黒のろうそく足の中ほどを下回っています。
白のろうそく足 - ロング・デイである必要はありません。
確認することを提案します。

これら3つのモデルには多くの共通点があります。がそれらの実装はいくらか違っています。そこに注意を払ってください。

      //------ 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. 3つのろうそく足を構成するパターン

パターン名 順序 分類パターン 外為 パターン認識
アップサイドギャップの3つの手法
(強気相場)

買い

パターンは
該当
ありません。
上昇傾向
最初の2つのろうそく足は差を伴う2つの「長い」白 ろうそく足です。
三番目のろうそく足は二番目の実体の長さ範囲内でオープンし、長さの差を補うように伸びます。確認することを提案します。
アップサイドギャップの3つの手法
(弱気相場)

売り

パターンは
該当
ありません。
下降傾向
最初の2つのろうそく足は差を伴う2つの「長い」黒のろうそく足です。
三番目のろうそく足は二番目の実体の長さ範囲内でオープンし、長さの差を補うように伸びます。確認することを提案します。
      //------      
      // 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);
           }
        }
パターン名 順序 分類パターン 外為 パターン認識
Upside Tasuki Gap
(強気相場)

買い

< パターンは
該当
ありません。
上昇傾向
2つの隣り合うろうそくの差白のろうそく足 は「長く」ある必要はありません。
三番目のセッションは二番目のろうそく足の実体の長さ範囲内でオープンします。三番目のセッションは差の範囲内でクローズしますが差は部分的に埋められません。確認することを提案します。
Downside Tasuki Gap
(弱気相場)

売り

パターンは
該当
ありません。
下降傾向
The gap between two neighboring black candles. Black ろうそく足s are not necessarily "long".
三番目のセッションは二番目のろうそく足の実体の長さ範囲内でオープンします。三番目のセッションは差の範囲内でクローズしますが差は部分的に埋められません。確認することを提案します。
      //------      
      // 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. 4つのろうそく足を構成するパターン

パターン名 順序 分類パターン 外為 パターン認識
Three-Line Strike
(強気相場)

買い

強気相場トレンドは3つのろうそく足で継続しています。3つの白の soldiersパターンに似ています。短いヒゲのある長い白ろうそく足 です。
外為:白いろうそく足の始値/終値は等しくなっています。
四番目の ろうそく足は上に隣との差を伴ってオープンし、一番目の白の ろうそく足の終値より下でクローズします。
外為:三番目のろうそく足の終値と四番目のろうそく足の始値は等しくなっています
確認することを提案します。
Three-Line Strike (bearish)

売り

弱気相場トレンドは3つのろうそく足で継続しています。3つの黒の crowsパターンに似ています。短いいヒゲのある長い黒のろうそく足s です。
外為:黒いろうそく足の始値/終値は等しくなっています。(3つの似通ったcrowsのようなものです。)
四番目の ろうそく足は下に差を伴ってオープンし、一番目の黒の ろうそく足をはるかに上回る上でクローズします。
外為:三番目のろうそく足の終値と四番目のろうそく足の始値は等しくなっています
確認することを提案します。
      //------      
      // 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 ろうそく足 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. インディケータの実装

必要な入力パラメータを選択します。

ろうそく足パターンインディケータの入力パラメータ

図3 ろうそく足パターンインディケータの入力パラメータ

最初のパラメータは「平均期間」です。トレンド方向を判断するため、「長い」また「短い」ろうそく足を定義するために必要です。

次のパラメータは「シグナルの有効化」です。シグナルを有効化/無効化するパラメータです。シグナルは新規パターンの登場を通知します。

ろうそく足パターンインディケータにより生成されるシグナル

図4 ろうそく足パターンインディケータにより生成されるシグナル

パラメータ「計算のためのバー数」はインディケータの作業を促進するために設計します。その値が0より小さいまたは同じならはろうそく足パターンは有効な全履歴から検索されます。そうでない場合は、設定されたバーの値が検索し使用されます。それはインディケータの作業をかなり促進します。

色についてはすべて明確になっていると思います。...

「コメントの有効化」はろうそく足パターンの有効/無効を意味します。

「フォントサイズ」はコメントのフォントサイズを設定します。

インディケータの実装はたいへんシンプルです。

新規バーが表示されるのを予想します。

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

それからサイクルを開始するカウンタの初期値を計算します。

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;

ループでは図5にあるようにろうそく足とそれの表示の組合せを確認します。

  • ひとつのろうそく足との組み合わせ:上または下のパターン名を持つ矢印
  • 2つのろうそく足との組み合わせ:最初のろうそく足の上または下のパターン名を持つ細い長方形
  • 3つのろうそく足との組み合わせ:最後のろうそく足の上または下のパターン名を持つ太い長方形

ろうそく足 パターンインディケータの作業方法例

図5 ろうそく足 パターンインディケータの作業方法例

関数オーバーロードの可能性があるため、異なるパターンのアウトプットはDrawSignal()と同じ名前の関数によって行われますが、パラメータ数は異なることに注意を払ってください。

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)

インディケータの全テキストは、本稿添付のCandlestick_Patterns.mq5ファイルにあります。


おわりに

本稿ではほとんどのろうそく足パターン、それらを検出する手法、MQL5プログラム言語でそれらを実装する方法を見てきました。本稿の添付は2つのインディケータとインクルードファイルです。それらを使用するには \Indicatorsフォルダにインディケータを配置し、コンパイルします。

ろうそく足パターンの分析がみなさんの作業結果の向上に役立つことを願っています。

先を見ますと、フィルタされたろうそく足は多くのテクニカルインディケータよりも良い結果をもたらすことを追加したいと思います。しかしわれわれはこの話題を次の稿で考えます。そこではトレーディングシステムの作成とろうそく足パターンによるExpert Advisorトレーディングの作成をするつもりです。

MetaQuotes Ltdによってロシア語から翻訳されました。
元の記事: https://www.mql5.com/ru/articles/101

かずかずのインスツルメントで取引を行うExpert Advisorの作成 かずかずのインスツルメントで取引を行うExpert Advisorの作成
ファイナンシャルマーケットにおける資産の多様性概念はかなり古いもので常に初心者のトレーダーを魅了してきました。本稿では、複数通貨対応Expert Advisorの構築をトレード戦略を扱う最初の導入として最大限にシンプルな手法で行います。
DelphiでDLLをMQL5向けに書くためのガイド DelphiでDLLをMQL5向けに書くためのガイド
本稿は、人気のプログラム言語ObjectPascalを使用しDelphiプログラム環境でDLLモジュールの作成メカニズムを検証します。本稿で使用している資料は、まずは問題を抱えたプログラム初心者用に考えられでおります。外部DLLに接続することでMQL5プログラム言語に埋め込まれた境界を破ります。
MQL5における移動平均計算パフォーマンス検証 MQL5における移動平均計算パフォーマンス検証
最初に「移動平均」インディケータが作成されて以来、多くのインディケータが登場してきました。それらの多くは類似の平滑化手法を使用していますが、異なる移動平均アルゴリズムの性能については研究されていません。本稿ではMQL5で「移動平均」を使用する可能な方法について考察し、それらのパフォーマンスを比較していきます。
平均足インジケーターに基づくトレーディングシステムの例 平均足インジケーターに基づくトレーディングシステムの例
この記事は、トレーディングにおける平均足インジケーターの使用についての疑問を詳しく見ていきます。このインジケーターに基づき、簡単な取引システムが検討され、MQL55アドバイザーが記述されました。取引処理は、Standardクラスライブラリに基づき実行されます。トレーディング戦略のテスト結果は、履歴に基づき、内蔵MetaTrader5ストラテジーテスター使用し、取得されます。