記事「多色ローソク足を作成するためのオプションの探究」についてのディスカッション

 

新しい記事「多色ローソク足を作成するためのオプションの探究」はパブリッシュされました:

この記事では、ローソク足でカスタマイズされたインジケーターを作成する可能性について説明し、それらの長所と短所を指摘します。

この最後の方法の大きな利点は、必要なバッファの数が大幅に増えたにもかかわらず、ユーザーインターフェイスに含まれる情報がより多いことですが、この利点は、色付けルールでビジネスルールに関する情報だけでなく、強気ローソク足と弱気ローソク足の区別も提供することで拡張できます。これは、前に見たローソク足の枠線と塗りつぶしの色を操作するだけで実行できます。デザインごとに、陰線の枠線と塗りつぶしは同じ色にします。陽線の塗りつぶしには白を使用し、背景が白の価格チャートでは、塗りつぶされていないローソク足のように見せます。


そこで、この記事の目的は、塗りつぶしの有無にかかわらず、ローソク足チャートに適用するビジネスルールに従って色付けルールを作成する方法のデモンストレーションです。作業の最終結果は下の画像に示されています。


作者: Samuel Manoel De Souza

 
素晴らしいチュートリアルだ、サミュエル!ありがとうございます!
 
素晴らしい......私の考えたローソク足も、取引用語について誰かに少し理解させることができるまっすぐなものです。赤は売り、緑は買いだと思いますが、緑が買うために上がるとき、赤は売るために下がりますが、そのラインの終点で、緑は逆を取らなければならず、赤も同様に移動 しなければなりません。 だから、これをmql5に置くことで、誰もが私のクエリ言語(私のQL)を知ることができます。
 

こんにちは、サミュエル、

いいアイデアだね。この記事にこの例を投稿できますか?


よろしくお願いします、

 
先物取引でティック・ローソク足の作り方
 
scalp-91 #:
先物取引のためのティック・ローソク足の作り方

https://www.mql5.com/ja/articles/60

Creación de indicadores de tick en MQL5
Creación de indicadores de tick en MQL5
  • www.mql5.com
En este artículo vamos a ver la creación de dos indicadores: el indicador de tick, que representa el gráfico de tick del precio, y el indicador de vela de tick, que representa las velas con el número de ticks especificados. Cada uno de los indicadores escribe los precios de llegada en un archivo y utiliza los datos guardados tras el reinicio del indicador (estos datos pueden ser usados también por los demás programas).
 
本当にありがとう。
 
cf23EA1l #:

こんにちは、サミュエル、

いいアイデアだね。この記事にこの例を投稿できますか?


よろしくお願いします、

//+------------------------------------------------------------------+
//|カラーキャンドルmq5|カラーキャンドル
//|Copyright 2020, サミュエル・マノエル・デ・ソウザ|著作権について
//|https://www.mql5.com/pt/users/samuelmnl|||.
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, Samuel Manoel de Souza"
#property link      "https://www.mql5.com/pt/users/samuelmnl"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 12
#property indicator_plots   3
//--- プロットブル
#property indicator_label1  "bull"
#property indicator_type1   DRAW_CANDLES
#property indicator_color1  clrGreen,clrBlack,clrGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- プロット・ベア
#property indicator_label2  "bear"
#property indicator_type2   DRAW_CANDLES
#property indicator_color2  clrRed,clrBlack,clrRed
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- プロット範囲
#property indicator_label3  "wait"
#property indicator_type3   DRAW_CANDLES
#property indicator_color3  clrGold,clrBlack,clrGold
#property indicator_style3  STYLE_SOLID
#property indicator_width3  1
//--- インジケータ・バッファ
double         bullBuffer1[];
double         bullBuffer2[];
double         bullBuffer3[];
double         bullBuffer4[];
double         bearBuffer1[];
double         bearBuffer2[];
double         bearBuffer3[];
double         bearBuffer4[];
double         rangeBuffer1[];
double         rangeBuffer2[];
double         rangeBuffer3[];
double         rangeBuffer4[];

input int inpShift = 0; //インジケーター・シフト
input int inpBlue = 10;//ブルー・シフト
input int inpRed = 20; //レッドシフト

//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int OnInit()
  {
   if(inpBlue <= 0)
     {
      Alert("Blue Shift must be greater then 0!");
      return INIT_PARAMETERS_INCORRECT;
     }
   if(inpRed <= inpBlue)
     {
      Alert("Red Shift must be greater then Blue Shift!");
      return INIT_PARAMETERS_INCORRECT;
     }
//--- インジケータ・バッファのマッピング
   SetIndexBuffer(0, bullBuffer1, INDICATOR_DATA);
   SetIndexBuffer(1, bullBuffer2, INDICATOR_DATA);
   SetIndexBuffer(2, bullBuffer3, INDICATOR_DATA);
   SetIndexBuffer(3, bullBuffer4, INDICATOR_DATA);
   SetIndexBuffer(4, bearBuffer1, INDICATOR_DATA);
   SetIndexBuffer(5, bearBuffer2, INDICATOR_DATA);
   SetIndexBuffer(6, bearBuffer3, INDICATOR_DATA);
   SetIndexBuffer(7, bearBuffer4, INDICATOR_DATA);
   SetIndexBuffer(8, rangeBuffer1, INDICATOR_DATA);
   SetIndexBuffer(9, rangeBuffer2, INDICATOR_DATA);
   SetIndexBuffer(10, rangeBuffer3, INDICATOR_DATA);
   SetIndexBuffer(11, rangeBuffer4, INDICATOR_DATA);
//---バーが見えなくなる値の設定
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0);
   PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, 0);
   PlotIndexSetDouble(2, PLOT_EMPTY_VALUE, 0);
//---各バーのシフト値の設定
   PlotIndexSetInteger(0, PLOT_SHIFT, inpShift);
   PlotIndexSetInteger(1, PLOT_SHIFT, inpShift);
   PlotIndexSetInteger(2, PLOT_SHIFT, inpShift);
//---バーがどこから描画されるかを設定する。
   PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, inpRed - 1);
   PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, inpRed - 1);
   PlotIndexSetInteger(2, PLOT_DRAW_BEGIN, inpRed - 1);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| カスタム・インジケータ反復関数|
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
//---十分なバーがない場合は計算しない。
   if(rates_total < inpRed)
     {
      return rates_total;
     }
//---どこから計算を始めるかを定義する。
   int limit;
   if(prev_calculated < inpRed)
      limit = inpRed;
   else
      limit = prev_calculated - 1;
//---メイン計算ループ
   for(int i = limit; i < rates_total; i++)
     {
      int shift = BarIndex2shift(i);
      double open = iOpen(_Symbol, _Period, shift);
      double high = iHigh(_Symbol, _Period, shift);
      double low = iLow(_Symbol, _Period, shift);
      double close = iClose(_Symbol, _Period, shift);
      double red = price[i - (inpRed)]; //レッドライン値の取得
      double blue = price[i - inpBlue]; //ブルーライン値の取得
      double yellow = price[i];     //イエローラインの値の取得
      //このフィルターには3つのフラグがある。
      //0 = 売り、1 = 待機、1 = 買い
      // 2本の線が赤より上にあれば買い。
      // 2本の線が赤より下にあれば、売ることができる。
      int direction = 0;
      direction += (yellow > red) ? 1 : 0; // 黄色が赤より上なら1を加える
      red = blue;
      blue = yellow;
      direction += (blue > red) ? 1 : 0; // 青が赤より上なら、1を加える。
      //デフォルトではバーは表示されない
      bullBuffer1[i] = 0;
      bullBuffer2[i] = 0;
      bullBuffer3[i] = 0;
      bullBuffer4[i] = 0;
      bearBuffer1[i] = 0;
      bearBuffer2[i] = 0;
      bearBuffer3[i] = 0;
      bearBuffer4[i] = 0;
      rangeBuffer1[i] = 0;
      rangeBuffer2[i] = 0;
      rangeBuffer3[i] = 0;
      rangeBuffer4[i] = 0;
      //方向フラグに従って、各バーに値を割り当てる。
      switch(direction)
        {
         case 0: // ベアマーケット
           {
            bearBuffer1[i] = open;
            bearBuffer2[i] = high;
            bearBuffer3[i] = low;
            bearBuffer4[i] = close;
            break;
           }
         case 1: // 強気市場
           {
            rangeBuffer1[i] = open;
            rangeBuffer2[i] = high;
            rangeBuffer3[i] = low;
            rangeBuffer4[i] = close;
            break;
           }
         case 2: // レンジ市場
           {
            bullBuffer1[i] = open;
            bullBuffer2[i] = high;
            bullBuffer3[i] = low;
            bullBuffer4[i] = close;
            break;
           }
        }
     }
//--- 次の呼び出しのためにprev_calculatedの値を返す
   return(rates_total);
  }

int BarIndex2shift(int bar) {return Bars(_Symbol, _Period) - bar - 1;}

//+------------------------------------------------------------------+
 
//+------------------------------------------------------------------+
//|カラーキャンドルmq5|カラーキャンドル
//| Copyright 2020, Samuel Manoel de Souza|サミュエル・マノエル・デ・ソウザの著作権について
//|https://www.mql5.com/ja/users/samuelmnl
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, Samuel Manoel de Souza"
#property link      "https://www.mql5.com/ja/users/samuelmnl"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 12
#property indicator_plots   3
//--- プロットブル
#property indicator_label1  "bull"
#property indicator_type1   DRAW_CANDLES
#property indicator_color1  clrGreen,clrBlack,clrGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- プロット・ベア
#property indicator_label2  "bear"
#property indicator_type2   DRAW_CANDLES
#property indicator_color2  clrRed,clrBlack,clrRed
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- プロット範囲
#property indicator_label3  "wait"
#property indicator_type3   DRAW_CANDLES
#property indicator_color3  clrGold,clrBlack,clrGold
#property indicator_style3  STYLE_SOLID
#property indicator_width3  1
//--- インジケータ・バッファ
double         bullBuffer1[];
double         bullBuffer2[];
double         bullBuffer3[];
double         bullBuffer4[];
double         bearBuffer1[];
double         bearBuffer2[];
double         bearBuffer3[];
double         bearBuffer4[];
double         rangeBuffer1[];
double         rangeBuffer2[];
double         rangeBuffer3[];
double         rangeBuffer4[];

input int inpShift = 0; //インジケーター・シフト
input int inpBlue = 10;//ブルー・シフト
input int inpRed = 20; //レッドシフト

//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int OnInit()
  {
   if(inpBlue <= 0)
     {
      Alert("Blue Shift must be greater then 0!");
      return INIT_PARAMETERS_INCORRECT;
     }
   if(inpRed <= inpBlue)
     {
      Alert("Red Shift must be greater then Blue Shift!");
      return INIT_PARAMETERS_INCORRECT;
     }
//--- インジケータ・バッファのマッピング
   SetIndexBuffer(0, bullBuffer1, INDICATOR_DATA);
   SetIndexBuffer(1, bullBuffer2, INDICATOR_DATA);
   SetIndexBuffer(2, bullBuffer3, INDICATOR_DATA);
   SetIndexBuffer(3, bullBuffer4, INDICATOR_DATA);
   SetIndexBuffer(4, bearBuffer1, INDICATOR_DATA);
   SetIndexBuffer(5, bearBuffer2, INDICATOR_DATA);
   SetIndexBuffer(6, bearBuffer3, INDICATOR_DATA);
   SetIndexBuffer(7, bearBuffer4, INDICATOR_DATA);
   SetIndexBuffer(8, rangeBuffer1, INDICATOR_DATA);
   SetIndexBuffer(9, rangeBuffer2, INDICATOR_DATA);
   SetIndexBuffer(10, rangeBuffer3, INDICATOR_DATA);
   SetIndexBuffer(11, rangeBuffer4, INDICATOR_DATA);
//---バーが見えなくなる値を設定する。
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0);
   PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, 0);
   PlotIndexSetDouble(2, PLOT_EMPTY_VALUE, 0);
//---各バーのシフト値の設定
   PlotIndexSetInteger(0, PLOT_SHIFT, inpShift);
   PlotIndexSetInteger(1, PLOT_SHIFT, inpShift);
   PlotIndexSetInteger(2, PLOT_SHIFT, inpShift);
//---バーがどこから描画されるかを設定する。
   PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, inpRed - 1);
   PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, inpRed - 1);
   PlotIndexSetInteger(2, PLOT_DRAW_BEGIN, inpRed - 1);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| カスタム・インジケータ反復関数
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
//---十分なバーがない場合は計算しない。
   if(rates_total < inpRed)
     {
      return rates_total;
     }
//---どこから計算を始めるかを定義する。
   int limit;
   if(prev_calculated < inpRed)
      limit = inpRed;
   else
      limit = prev_calculated - 1;
//---メイン計算ループ
   for(int i = limit; i < rates_total; i++)
     {
      int shift = BarIndex2shift(i);
      double open = iOpen(_Symbol, _Period, shift);
      double high = iHigh(_Symbol, _Period, shift);
      double low = iLow(_Symbol, _Period, shift);
      double close = iClose(_Symbol, _Period, shift);
      double red = price[i - (inpRed)]; //レッドライン値の取得
      double blue = price[i - inpBlue]; //ブルーライン値の取得
      double yellow = price[i];     //イエローラインの値の取得
      //このフィルターには3つのフラグがある。
      //0 = 売り、1 = 待機、1 = 買い
      // 2本の線が赤より上にあれば買い。
      // 2本の線が赤より下にあれば、売ることができる。
      int direction = 0;
      direction += (yellow > red) ? 1 : 0; // 黄色が赤より上なら1を加える
      red = blue;
      blue = yellow;
      direction += (blue > red) ? 1 : 0; // 青が赤より上なら、1を加える。
      //デフォルトではバーは表示されない
      bullBuffer1[i] = 0;
      bullBuffer2[i] = 0;
      bullBuffer3[i] = 0;
      bullBuffer4[i] = 0;
      bearBuffer1[i] = 0;
      bearBuffer2[i] = 0;
      bearBuffer3[i] = 0;
      bearBuffer4[i] = 0;
      rangeBuffer1[i] = 0;
      rangeBuffer2[i] = 0;
      rangeBuffer3[i] = 0;
      rangeBuffer4[i] = 0;
      //方向フラグに従って、各バーに値を割り当てる。
      switch(direction)
        {
         case 0: // ベアマーケット
           {
            bearBuffer1[i] = open;
            bearBuffer2[i] = high;
            bearBuffer3[i] = low;
            bearBuffer4[i] = close;
            break;
           }
         case 1: // 強気市場
           {
            rangeBuffer1[i] = open;
            rangeBuffer2[i] = high;
            rangeBuffer3[i] = low;
            rangeBuffer4[i] = close;
            break;
           }
         case 2: // レンジ市場
           {
            bullBuffer1[i] = open;
            bullBuffer2[i] = high;
            bullBuffer3[i] = low;
            bullBuffer4[i] = close;
            break;
           }
        }
     }
//--- 次の呼び出しのためにprev_calculatedの値を返す
   return(rates_total);
  }

int BarIndex2shift(int bar) {return Bars(_Symbol, _Period) - bar - 1;}

//+------------------------------------------------------------------+
 
この記事を読んで、自分のチャートに適用することができました。 質問なのですが、このインディケータをEAで呼び出して自動売買を行う方法や、視覚化されたストラテジーテスターについて 説明した記事はありますか?
 
PanteraNoire ストラテジーテスターを 使用する方法を説明した記事はありますか?

いいえ。

iCustomを使う必要があります。iCustomを使用する必要があります。また、色と値については、インジケータのバッファ番号を参照してください。