Errors, bugs, questions - page 328

 
DenisR:
I also had 15 505 1009 at first, but then the terminal was updated to the latest version (408) and it became 5 505 1009. But in any case, the end of file sign cannot be bigger than the size of the file itself. That's what worries me the most right now.
Well, yeah, it's a bit odd...
 

Slightly modified example of an indicator from the helpdesk:

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2010, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots   1
//---- plot Line
#property indicator_label1  "Line"
#property indicator_type1   DRAW_LINE
#property indicator_color1  DarkBlue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         LineBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,LineBuffer,INDICATOR_DATA);
//---
   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[])
  {
//--- получим количество доступных баров для текущих символа и периода на графике
   if(prev_calculated<=0) 
     {
      int bars=Bars(Symbol(),0);
      Print("Bars = ",bars,", rates_total = ",rates_total,", prev_calculated = ",prev_calculated);
      Print("time[0] = ",time[0]," time[rates_total-1] = ",time[rates_total-1]);
      //--- return value of prev_calculated for next call
     }
   return(rates_total);
  }

Throw for example USDJPY (1h). Then, for example, run it on #C (30m). This all is done while the USA market has not opened yet. And we see that as soon as a tick comes on the USDJPY, OnCalculate at #C triggers, moreover, prev_calculated=0. And on the USDJPY itself, prev_calculated != 0 before the new bar. Looks like an obvious bug to me, although I may be missing something. Build 408

 
notused:

Throw, for example, on USDJPY (1h). Then, for example, we start it on #C (30m). All this is done while the US market has not yet opened. And we see that as soon as a tick comes on USDJPY, OnCalculate at #C triggers, moreover, prev_calculated=0. And on the USDJPY itself, prev_calculated != 0 before the new bar. Looks like an obvious bug to me, although I may be missing something. Build 408

This kind of thing has already been discussed: https://www.mql5.com/ru/forum/3283/page2#comment_50176(last two paragraphs; you can see the whole thread as well).
Почему срабатывает OnCalculate по выходным, когда нет тиков?
Почему срабатывает OnCalculate по выходным, когда нет тиков?
  • www.mql5.com
Событие Calculate генерируется только для индикаторов сразу после посылки события Init и при любом изменении ценовых данных.
 
Yedelkin:
This has already been discussed: https://www.mql5.com/ru/forum/3283/page2#comment_50176(last two paragraphs; and you can see the whole thread).
Thank you, good to know
 
Question. The indicator buffer contains integers or, for example, time. Can I make the indicator buffer values be displayed in the DataWindow as integers or, for example, as time?
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
  • 2010.10.25
  • Nikolay Kositsin
  • www.mql5.com
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
 
Lizar:
Question. The indicator buffer contains integers or, for example, time. Can I make the DataWindow display the indicator buffer values as integers or, for example, as time?

as a whole you can - by reducing the INDICATOR_DIGITS


 
sergeev:

as a whole you can - by reducing the INDICATOR_DIGITS

Then all the doubles will become integers, too :(
 
Lizar:
Question. The indicator buffer contains integers or, for example, time. Can I make the indicator buffer values be displayed in DataWindow as integers, or, for example, as time?
At the moment, the indicator buffers are positioned as arrays of type double. Therefore, in DataWindow, buffer values should be displayed as values of type double. Without the developers, we probably will not be able to solve the problem on our own.
 
Yedelkin:
Currently индикаторные буферы is positioned as an array of type double. Correspondingly, the DataWindow will display the buffer values as values of type double. Apparently, we cannot solve the problem on our own, without developers.
Wow...
 
Yedelkin:
The indicator buffers are currently positioned as arrays of type double. Respectively, buffer values are displayed in DataWindow as values of type double. Apparently, we will not be able to solve this problem without the developers.
Let the indicator buffers be positioned as arrays of the double type. It is possible to make int and datatime from double. But you can not show the converted result. Indicators are simply more powerful, while the displaying of results in the DataWindow remains the same. I would like to write a request to Service Desk.