Questions from Beginners MQL5 MT5 MetaTrader 5 - page 708

 

Good afternoon. I'm normalising the values, but in debugging the numbers with *e how come?

I can't write the values into Excel.

If another parameter is assigned to the array (arrayZ[0][q][z] = 0;), it saves

for(int z = 0; z < copied && z<=ARRAY_SIZE_X; z++) // отбор по барам
   {
    arrayIndexY[z] = srcArr[z].close; //данные колонки У

    for(int q = 1; q <= copied-1; q++) //Перебор периодов
    {
  
    {
    qer = NormalizeDouble(sm.d[q-1].m[nBar-z],Digits());
    wer = NormalizeDouble(sm.d[q].m[nBar-z],Digits());
    arrayZ[0][q][z] = NormalizeDouble(qer-wer,Digits());} // ответы с е, че заааа


    }
      
   }
   flag = false;
        
   GenerateCsv("test.csv");  
   }
Files:
d4rw9gqntl.jpg  157 kb
 
Top2n:

Good afternoon. I'm normalising the values, but in debugging the numbers with *e how come?

I can't write the values into Excel.

If another parameter is assigned to the array (arrayZ[0][q][z] = 0;), it saves

for(int z = 0; z < copied && z<=ARRAY_SIZE_X; z++) // отбор по барам
   {
    arrayIndexY[z] = srcArr[z].close; //данные колонки У

    for(int q = 1; q <= copied-1; q++) //Перебор периодов
    {
  
    {
    qer = NormalizeDouble(sm.d[q-1].m[nBar-z],Digits());
    wer = NormalizeDouble(sm.d[q].m[nBar-z],Digits());
    arrayZ[0][q][z] = NormalizeDouble(qer-wer,Digits());}
    qer;

    }
      
   }
   flag = false;
        
   GenerateCsv("test.csv");  
   }
UseDoubleToString() for print output.
 
Artyom Trishkin:
Use DoubleToString() for print output.
Thank you!
 
Hello, is it true that it's possible to make money on this forum? If so, could you tell me how?
 
elektrik777:
Hello, is it true that it's possible to make money on this forum? If so, could you tell me how?
No longer relevant - this possibility has been disabled, but you can program, sell computer resources and write articles.
 

Good time, Task: Find H(max) or L(min) prices in a given number of bars in question.

I have poked around, I cannot assign a selection range, i.e. where to insert the variable (DO), to select the search interval

double UpperFractal(int DO)  // Фрактал UP
{
  //--- объявление переменных
   int n,UpperFractal_1;
//--- объявление массивов для записи значений буферов индикатора iFractal
   double FractalUp[];
   double UpFractal_1;
//--- сначала нужно записать в массивы значения буферов индиктора Fractal
//--- заполнение данными буфера
   CopyBuffer(Fractal,0,TimeCurrent(),Bars(Symbol(),PERIOD_D1),FractalUp);
//--- индексация как в таймсериях
   ArraySetAsSeries(FractalUp,true);
  
//--- далее используем оператор цикла for для поиска первого верхнего фрактала
   for(n=0; n<Bars(Symbol(),PERIOD_CURRENT); n++)
     {
      //--- если непустое значение, прерываем цикл
      if(FractalUp[n]!=EMPTY_VALUE)
         break;
     }
//--- запишем ценовое значение первого фрактала в переменную
   UpFractal_1=FractalUp[n];
//--- запишем индекс первого фрактала в переменную
   UpperFractal_1=n;
  
   return (UpFractal_1);
}
 
Top2n:

Good time, Task: Find H(max) or L(min) prices in a given number of bars in question.

I have poked around, I cannot assign a selection range, i.e. where to insert the variable (DO), to select the search interval

double UpperFractal(int)  // Фрактал UP
{
  //--- объявление переменных
   int n,UpperFractal_1;
//--- объявление массивов для записи значений буферов индикатора iFractal
   double FractalUp[];
   double UpFractal_1;
//--- сначала нужно записать в массивы значения буферов индиктора Fractal
//--- заполнение данными буфера
   CopyBuffer(Fractal,0,TimeCurrent(),Bars(Symbol(),PERIOD_D1),FractalUp);
//--- индексация как в таймсериях
   ArraySetAsSeries(FractalUp,true);
  
//--- далее используем оператор цикла for для поиска первого верхнего фрактала
   for(n=0; n<Bars(Symbol(),PERIOD_CURRENT); n++)
     {
      //--- если непустое значение, прерываем цикл
      if(FractalUp[n]!=EMPTY_VALUE)
         break;
     }
//--- запишем ценовое значение первого фрактала в переменную
   UpFractal_1=FractalUp[n];
//--- запишем индекс первого фрактала в переменную
   UpperFractal_1=n;
  
   return (UpFractal_1);
}


Why do I have to use fractals?

First CopyHigh() for the required range, and then in the array where the range is copied, look for max (ArrayMaximum()).

Same for min, but CopyLow() and ArrayMinimum()

 
Thank you!!!!!
 

I don't understand what's wrong, the task is to find the min value on a given interval (index)

//+------------------------------------------------------------------+
//| Получим Low для заданного номера бара                            |
//+------------------------------------------------------------------+
double iLow(string symbol,ENUM_TIMEFRAMES timeframe,int index)
  {
   double low=0;
   ArraySetAsSeries(Low,true);
   int copied=CopyLow(symbol,timeframe,0,index,Low);
   if(copied>0 && index<copied) low=ArrayMinimum(Low);
   return(low);
  }
 
Top2n:

I don't understand what's wrong, the task is to find the min value on a given interval (index)

//+------------------------------------------------------------------+
//| Получим Low для заданного номера бара                            |
//+------------------------------------------------------------------+
double iLow(string symbol,ENUM_TIMEFRAMES timeframe,int index)
  {
   double low=0;
   ArraySetAsSeries(Low,true);
   int copied=CopyLow(symbol,timeframe,0,index,Low);
   if(copied>0 && index<copied) low=ArrayMinimum(Low);
   return(low);
  }


ArrayMinimum returns the INDEX of the element, which value is the lowest. Now we need to get the value itself from theLow array by the indexlow:

Low[low]

Reason: