Errors, bugs, questions - page 59

 
Renat:

Fortunately, the problem of old configs is behind us. 50 builds ago is a very long time and we have allowed ourselves to change formats several times.

For the brokers we have provided not only a distributed distribution delivery network, but also a centralised repository of all distributions at files.metaquotes.net - this fundamentally solves the problem of timely updates of hundreds of copies of distributions for different companies.

In any case, my apologies for this unpleasantness - I'm sure it won't happen again.

In addition, we will now apply an even more advanced method of automatically and securely locating broker trading servers when connections to known access points fail. This will fundamentally solve the problem of publishing lists of working access points.

Thank God Alpari is sorted out, I think the release is now available there on the website 291. It remains for Admiral markets to explain that it is not necessary to keep the old version on the site - there is a 237 release weighing 7 mb... :)
 
EQU:

Guys, what's with the cursor... It's definitely F7, it's popping out...

Instead of hosannas - just words...

and the hotkeys - please - bring back... it's not difficult... it's a habit - it's been drawn for years...


As for the hotkeys - accepted. The task is there.

It's a bit more complicated with the cursor. Still not observed even by the actions you mentioned.

 

I wrote such a situation, I tried to run it, terminal crashes.

2010.07.22 13:43:55 StandardDeviationChannel (EURUSD,M1) Array out of range in 'StandardDeviationChannel.mq5' (114,51)

I've taken an example from MACD indicator in the standard set of custom indicators in the folder ...\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:

I wrote such a situation, I try to run it, terminal crashes.

2010.07.22 13:43:55 StandardDeviationChannel (EURUSD,M1) Array out of range in 'StandardDeviationChannel.mq5'(114,51)

Please indicate where line 114 and 51 positions are located in the attached code.
 
ExtUpBuffer[i]=ExtMABuffer[i]+(InpDeviation*E xtStdDevBuffer[i]);
highlighted in red
 
sergey1294:
highlighted in red.

Apparently your to_copy is clearly less than rates_total.
 
mql5:
Apparently, your to_copy is clearly less than rates_total.

Yes, to_copy=1.
 
Rosh:
Yes, to_copy=1.

and how can this be fixed? if it is one, why is it that when you remove these lines

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

the indicator starts working and displays МА

 
sergey1294:

and how can this be fixed? if it is one, why is it that when you remove these lines

the indicator starts working and displays МА


You have specified

#property indicator_buffers 4

and you set it to

   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:
You pointed out

#property indicator_buffers 4

but you did.

Thank you so much, I hadn't noticed such a small thing, it's OK now
Reason: