Errors, bugs, questions - page 813

 
VNIK:
Alternatively: create a new thread in the Trading Systems section with a link to the existing one and continue there.

Thanks. Thinking about... the same thing... like part 1, part 2.

Maybe someone more worthy would like to do it... :-)

 
Rosh:
Unfortunately, there is no such option.
Why did you break it? It used to be. After the appearance of Trading Systems, a couple of topics were moved there.
 
I voted in the forum using Google Chrome with online translation, then I went to Firefox (always use it) and again I can vote in the same thread, is it a browser problem or a site bug?
 

Question for macro substitution experts...

In the script:

double plot1[],plot2[],plot3[];

#define macr(i) ploti
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   for(int i=0;i<3;i++)
     ArrayResize(macr(i),100);
  }

I need to substitute plot1, plot2 and plot3 instead of macr(i) in the for loop... According to my version, the substitution is as ploti, which is not needed at all :-(

Thanks in advance!
 
It won't work. MQL5 preprocessor does not support concatenation of tokens via ##. You could write a suggestion to servicedesk. Or use a two-dimensional array instead of several one-dimensional ones.
 
denkir:

...

I need plot1, plot2 and plot3 to be substituted for macr(i) in the for loop... According to my version, the substitution goes as ploti, which is not needed at all :-(

Thanks in advance!
How about trying to do it with a pointer array?
 
Question. In the article Migration from MQL4 to MQL5 in Table "18. Access to Timeseries" in the "MQL5" column, the author uses a dimensionless array Arr[] inside functions. I see that the function always returns only one value of the zero element of the array. Does anyone know if there is some hidden meaning in using a dimensionless array instead of Arr[1]? The Help says that knowing the size of the array, you'd better specify that many elements.
 
paladin800:
Question. In the article Migration from MQL4 to MQL5, the "18. Access to Timeseries" in the "MQL5" column, the author uses a dimensionless array Arr[] inside the functions. I see that the function always returns only one value of the zero element of the array. Does anyone know if there is some hidden meaning in using a dimensionless array instead of Arr[1]? They write in the Help that the number of elements should be specified knowing the array size.

There are.

In MQL5, this array is passed as an argument to functions that manage its size according to their own logic,

namely, they redistribute the size automatically depending on the passed parameters start point and amount of data to be copied.

If you pass a static array as an argument to the CopyXXX function, you will get an error.

ZZZ The code checks the size of the array and then makes a decision depending on the size, so the size is most likely not static.

 

In external EA parameters I use parameter R only = 1 or 2 or 12 or 13 (general simple example). You can check this parameter in OnInit() and report an error if a citizen enters a different number by mistake. However, there are ENUM_... types for input. (eg. ENUM_MA_METHOD), when we can simply select a value from the expanded window.

Question. Is there such an option, where it is possible to make such a construction, so that in external parameters by analogy with the ENUM_... appear only what the programmer intended, without the need to check OnInit(). I haven't found it in the documentation. If not, the wish is to do such a thing.

Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
paladin800:

Question. Is there an option where you can make such a construction, so that in external parameters by analogy with ENUM_... appear only what the programmer intended, without the need to check OnInit(). I haven't found it in the documentation. If you don't find it, please make such a thing.

Please explain in other words. I don't understand what I mean.