Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 791

 
ukrop1203:
No, only "loaded successfully" and "removed".

Yes, saw it, tried your code to load, there's a stack overflow by

2019.03.26 19:38:16.053 Stack overflow

tried to move globally described variables in the OnStart() section did not help, maybe somewhere in the code you have a large amount of data, you need to understand what you're doing, and the code is not optimal written, I can not so quick help


 

Karoche I missed this in the log, my script uses large arrays of double (3 arrays of 864000). Reduced by 10 times, all works, I'm at a low level is not versed, tell me what kind of iron needs to pump in order for such things to work, just add RAM? I certainly will not buy a special for the prog, I'll rewrite it, just wondering.


 
ukrop1203:

Karoche I missed this in the log, my script uses large arrays of double (3 arrays of 864000). Reduced by 10 times, all works, I'm at a low level is not versed, tell me what kind of iron need to pump in order for such things to work, just add RAM? I certainly will not buy a special for the prog, I'll rewrite it, just wondering.


3 x 8 x 864000 = 20736000 bytes

this is too much, mt4 is 32 bit, i don't want to search for information, but i think 32 bit programs have 2 gb memory limit

My device has nothing to do with it.

ZS: recalculated 20736000 bytes is 20 Mb, not much in principle, probably you have statically described arrays, try to change to dynamic arrays and then resize, maybe it will help - I have not read for a long time how memory in MT is allocated, but the script was crashed because of stack overflow - somewhere the memory is much reserved

 
How to create an array via new so that it will be written in chem? I only understood how to create a class with an array in the field, but it would be weird to use it, in c++ it looks like this: int *array = new int[n]; It doesn't work here.
 
ukrop1203:
How to create an array via new so that it will be written in chem? I only understood how to create a class with an array in the field, but it would be weird to use it, in c++ it looks like this: int *array = new int[n]; It doesn't work here.
double x[];
ArrayResize(x,1000);

https://docs.mql4.com/ru/array/arrayresize

ArrayResize - Операции с массивами - Справочник MQL4
ArrayResize - Операции с массивами - Справочник MQL4
  • docs.mql4.com
При успешном выполнении функция возвращает количество всех элементов, содержащихся в массиве после изменения размера; в противном случае возвращает -1 и массив не меняет размеры. Функция может быть применена только к динамическим массивам. При этом необходимо иметь ввиду, что нельзя изменять размер для динамических массивов, назначенных в...
 
Can you tell me how to display the ASK price five characters after the point in Print instead of four?
 
nkss2020:
Can you tell me how to display the ASK price five characters after the point in Print instead of four?
Print("Ask: ",DoubleToString(Ask,5));
 
There is a date of e.g. 26.03.2019, how can we calculate 3 days from this, so that 23.03.2019 would appear in the Comment?
 
ponochka:
Date 26.03.2019 for example, how to convert it into 3 days, so that the Comment would come 23.03.2019?
Date-3*PeriodSeconds(PERIOD_D1);
 
Alexey Viktorov:

You're the one who took 24 hours.

ZS. And you're the one who removed yourself...

Reason: