エラー、バグ、質問 - ページ 59

 
Renat:

幸いなことに、古いコンフィグの問題は解決されました。50ビルド前というのは非常に長く、何度かフォーマットを変更することを許しています。

ブローカーに対しては、 分散型配信ネットワークだけ でなく、すべての配信をfiles.metaquotes.netに集約したリポジトリも提供しました。これは、異なる企業の何百もの配信コピーをタイムリーに更新する問題を根本的に解決するものです。

いずれにせよ、このような不愉快な思いをさせてしまったことをお詫びします。

また、既知のアクセスポイントへの接続に失敗した場合、ブローカー取引サーバーを自動的かつ安全に特定する、より高度な方法を適用することになりました。これにより、稼働中のアクセスポイントのリスト公開の問題が根本的に解決されます。

アルパリが整理されたのはありがたい、291のサイトでそこそこリリースされるようになったのだろう。アドミラルマーケットは、古いバージョンをサイトに残しておく必要がないことを説明するために、7MBの重さの237のリリースが残っています...。:)
 
EQU:

みんな、このカーソルは何だ...確かにF7、飛び出してますね...。

ホサナではなく、言葉だけで...。

とホットキーは - お願い - 戻してください - 難しいことではありません - 習慣です - 何年も前から描かれています - と。


ホットキーについては - 受け入れました。課題はそこにある。

カーソルはもう少し複雑です。まだ、おっしゃるようなアクションでも観測されません。

 

そんな状況を書いて、実行しようとすると、ターミナルがクラッシュしてしまいます。

2010.07.22 13:43:55 StandardDeviationChannel (EURUSD,M1) 'StandardDeviationChannel.mq5' の配列が範囲外 (114,51)になっています。

MACDは、...╱MQL5↩Indicators╱Examplesの中にあるカスタムインジケータの標準セットに含まれているインジケータを例にしています。

//+------------------------------------------------------------------+
//|                                     StandardDeviationChannel.mq5 |
//|                                                    Сергей Грицай |
//|                                               sergey1294@list.ru |
//+------------------------------------------------------------------+
#property copyright "Сергей Грицай"
#property link      "sergey1294@list.ru"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots   3
#property indicator_type1   DRAW_LINE
#property indicator_type2   DRAW_LINE
#property indicator_type3   DRAW_LINE
#property indicator_color1  DodgerBlue
#property indicator_color2  DodgerBlue
#property indicator_color3  Blue
#property indicator_style3  STYLE_DOT

input int                InpMAPeriod=14;              // Period
input int                InpMAShift=0;                // Shift
input ENUM_MA_METHOD     InpMAMethod=MODE_SMA;        // Method
input ENUM_APPLIED_PRICE InpAppliedPrice=PRICE_CLOSE; // Applied price
input int                InpDeviation=2.0;            // Deviation
//--- indicator buffers
double                   ExtUpBuffer[];
double                   ExtDownBuffer[];
double                   ExtMiddBuffer[];
double                   ExtMABuffer[];
double                   ExtStdDevBuffer[];
//--- indicator handle
int                      ExtMAHandle;
int                      ExtStdDevMAHandle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,ExtUpBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ExtDownBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,ExtMiddBuffer,INDICATOR_DATA);
   SetIndexBuffer(3,ExtMABuffer,INDICATOR_CALCULATIONS);
   SetIndexBuffer(4,ExtStdDevBuffer,INDICATOR_CALCULATIONS);
   
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,InpMAPeriod-1);
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpMAPeriod-1);
   PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,InpMAPeriod-1);


   ExtMAHandle=iMA(NULL,0,InpMAPeriod,0,InpMAMethod,InpAppliedPrice);
   ExtStdDevMAHandle=iStdDev(NULL,0,InpMAPeriod,0,InpMAMethod,InpAppliedPrice);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
//--- return value of prev_calculated for next call
   if(rates_total<InpMAPeriod)
      return(0);
//--- not all data may be calculated
   int calculated=BarsCalculated(ExtMAHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtMAHandle is calculated (",calculated,"bars ). Error",GetLastError());
      return(0);
     }
   calculated=BarsCalculated(ExtStdDevMAHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtStdDevMAHandle is calculated (",calculated,"bars ). Error",GetLastError());
      return(0);
     }
//--- we can copy not all data
   int to_copy;
   if(prev_calculated>rates_total || prev_calculated<0) to_copy=rates_total;
   else
     {
      to_copy=rates_total-prev_calculated;
      if(prev_calculated>0) to_copy++;
     }
//--- get MA buffer
   if(CopyBuffer(ExtMAHandle,0,0,to_copy,ExtMABuffer)<=0)
     {
      Print("Getting fast MA is failed! Error",GetLastError());
      return(0);
     }
//--- get StdDev buffer
   if(CopyBuffer(ExtStdDevMAHandle,0,0,to_copy,ExtStdDevBuffer)<=0)
     {
      Print("Getting slow StdDev is failed! Error",GetLastError());
      return(0);
     }
//---
   int limit;
   if(prev_calculated==0)
      limit=0;
   else limit=prev_calculated-1;
//--- the main loop of calculations
   for(int i=limit;i<rates_total;i++)
     {
      ExtMiddBuffer[i]=ExtMABuffer[i];
      ExtUpBuffer[i]=ExtMABuffer[i]+(InpDeviation*ExtStdDevBuffer[i]);
      ExtDownBuffer[i]=ExtMABuffer[i]-(InpDeviation*ExtStdDevBuffer[i]);
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
sergey1294:

そんな状況を書いて、実行しようとすると、ターミナルがクラッシュする。

2010.07.22 13:43:55 StandardDeviationChannel (EURUSD,M1) 'StandardDeviationChannel.mq5' の配列が範囲外(114,51)になっています。

114行目と51行目の位置は、添付のコードのどこにあるか教えてください。
 
ExtUpBuffer[i]=ExtMABuffer[i]+(InpDeviation*E xtStdDevBuffer[i]);
赤色表示
 
sergey1294:
を赤色で表示しました。

どうやら、to_copyがrates_totalより明らかに少ないようです。
 
mql5:
どうやら、to_copyがrates_totalより明らかに少ないようです。

はい、to_copy=1です。
 
Rosh:
はい、to_copy=1です。

で、これはどうしたら直るのでしょうか? もし一つなら、なぜこの線を削除すると

      ExtUpBuffer[i]=ExtMABuffer[i]+(InpDeviation*ExtStdDevBuffer[i]);
      ExtDownBuffer[i]=ExtMABuffer[i]-(InpDeviation*ExtStdDevBuffer[i]);

インジケーターが作動し、МАを表示します。

 
sergey1294:

で、これはどうしたら直るのでしょうか? もし一つなら、なぜこの線を削除すると

インジケーターが作動し、МАを表示します。


を指定しました。

#property indicator_buffers 4

に設定し、それを

   SetIndexBuffer(0,ExtUpBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ExtDownBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,ExtMiddBuffer,INDICATOR_DATA);
   SetIndexBuffer(3,ExtMABuffer,INDICATOR_CALCULATIONS);
   SetIndexBuffer(4,ExtStdDevBuffer,INDICATOR_CALCULATIONS);
 
mql5:
ご指摘の通り

#property indicator_buffers 4

でも、そうだったんですね。

ありがとうございます、こんな小さなことに気がつきませんでした、もう大丈夫です