[アーカイブ!】どんなエキスパートやインジケーターでも無料で書きます。 - ページ 89

 
Vinin:
簡単ではない。バッファが足りない。
バッファが足りなくなる。しかし、作者はヒストグラムしか欲しがらなかった :))
"異なる値を持つ3つのヒストグラムを意味します"
削除済み  
granit77:
これではダメなんです。しかし、作者はヒストグラムしか欲しがらなかった :))
"異なる値を持つ3つのヒストグラムを意味します"

では、3つのヒストグラムを作るのは現実的ではないのでしょうか?私はこのコードに無駄な時間を費やしているだけなのでしょうか?
削除済み  
こちらはベースとして使っています。3つ目のヒストグラムを追加する方法がわからない。どうしたらいいんだろう。逆立ち以外はね。
 
alkeon:
では、3つのヒストグラムを作るのは現実的ではないのでしょうか?せっかく苦労して暗号を解いたのに無駄だったのか?
無駄なものはない。結果よりも、経験がものを言う。
この特定のケースでは、必要なMACDコピーの数に依存します。1枚で2つのバッファ(ヒストグラムとシグナルライン)が必要なので、合計8つのバッファが必要です。つまり、3枚で6枚のバッファを使っても、まだ余るということです。
苦悩はどうですか?コードはどこにあるのですか?

P.S.
私はあなたの試作品が好きではありません。MACDが2つあるのではなく、シーケンシャルスムージングです。シンプルなクラシックMACDを3倍にした方がいい。
ファイル:
macd.mq4  3 kb
削除済み  
主ないじめの原因は、パソコンでの作業にある。 でも大丈夫、もう散々苦しめたから、何を繰り返せばいいのか丸暗記してるんだ。
削除済み  
その方が楽だから(やっぱり)。インジケーターをありがとうございます!これからコツコツとやっていこうと思います。
削除済み  

ここからが本題です。 計算式に全く戸惑う。どうしたんですか?

エラーもなく、最新版です。しかし、それがまた厄介なんです。

ファイル:
macd_3.mq4  5 kb
 
一般的には、方向性は正しい、間違いを直せばうまくいく。修正するのではなく、言葉で説明する。

//+------------------------------------------------------------------+
//|                                                  Custom MACD.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2004, MetaQuotes Software Corp."
#property  link      "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 6
#property  indicator_color1  Silver
#property  indicator_color2  Red
#property  indicator_color3  Silver
#property  indicator_color4  Red
#property  indicator_color5  Silver
#property  indicator_color6  Red
#property  indicator_width1  2
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int FastEMA1=12;
extern int SlowEMA1=26;
extern int SignalSMA1=9;
extern int FastEMA2=12;
extern int SlowEMA2=26;
extern int SignalSMA2=9;
//---- indicator buffers
double     MacdBuffer[]; //Проверить соответствие нумерации
double     SignalBuffer[];
double     MacdBuffer1[];
double     SignalBuffer2[];
double     MacdBuffer3[];
double     SignalBuffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);// нумерация буферов должна идти подряд от 0 до 6
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(Digits+1);
    SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(Digits+1);
    SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(Digits+1);
//---- indicator buffers mapping
   SetIndexBuffer(0,MacdBuffer);
   SetIndexBuffer(1,SignalBuffer);
   SetIndexBuffer(0,MacdBuffer);
   SetIndexBuffer(1,SignalBuffer);
   SetIndexBuffer(0,MacdBuffer);
   SetIndexBuffer(1,SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+","+FastEMA1+","+SlowEMA1+","+SignalSMA1+","+FastEMA2+","+SlowEMA2+","+SignalSMA2+")");
   SetIndexLabel(0,"MACD");
   SetIndexLabel(1,"Signal");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   // Эта часть пишется только 1 раз
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   //-------------------------------  
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
      MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
      SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
      
      
      int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
      MacdBuffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
      SignalBuffer2[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
      
      
      int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
      MacdBuffer3[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
      SignalBuffer4[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
      
//---- done
   return(0);
  }
//+------------------------------------------------------------------+
[Deleted]  

親愛なるkubodelさん、各時間枠の00分ではなく、取引を開始するようにアドバイザーを修正してください。

と、キャンドルタイムフレームの開始から30秒後

 
abolk:

バッファの数字を第一近似値まで調整した - あとはあなた次第です。

アンドレイ・ニコラエビッチ、何を急いでるんだ!?自分で考えたはずなのに、もっとよく覚えていたはずだ。