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

 
WhiteBerkut:

Good evening.

I started studying mql5 and have some questions, so please help.

The task is to get the values of the last n candlesticks into an array and sort the array by choosing only the unbeaten candlesticks.

I have written the function:

It generates an errorarray out of range.

As far as I understood, this error is caused by addressing a non-existing cell of the array.

But I haven't managed to find this error, please advise where I've screwed up, or maybe there is a more elegant sorting.

ArrayResize(temp, count);

Документация по MQL5: Операции с массивами / ArrayResize
Документация по MQL5: Операции с массивами / ArrayResize
  • www.mql5.com
При успешном выполнении функция возвращает количество всех элементов, содержащихся в массиве после изменения размера; в противном случае возвращает -1 и массив не меняет размеры. Если ArrayResize() применена к статическому массиву, таймсерии или индикаторному буферу, то размер массива остается прежним – такие массивы не могут быть...
 
STARIJ:
Compare the index value with the array dimension. Keep in mind that array elements are numbered starting from zero, and the number of the last one is 1 less than the dimensionality. And NumCand is equal to what?

NumCand has been set to 10 so far. The function in general is accessed with a constant

printf(iHigh(Symbol(),0,0));
 
Vitaly Muzichenko:

ArrayResize(temp, count);


Do you need to change the size of the array? I seem to be filling a new dynamic array, not changing the old one.

 

Hello!
Can you tell me how to make a vertical line in the indicator window? At the moment I use a histogram but it doesn't suit me, I would like to see a line from the bottom to the top of the indicator window.

ObjectCreate in the indicator window will work?
 
Nauris Zukas:

Hello!
Could you tell me how to make a vertical line in the indicator window? At the moment I am using a histogram but it doesn't suit me, I would like to see a line from the bottom to the top of the indicator window.

ObjectCreate in the indicator window will work?

Yes, of course.

 
Vitaly Muzichenko:

Yes, of course.

Thanks, I'll give it a try.

 

Windows XP-3. Right-clicking on the audio file icons and then the "Properties" button reads: "File type: AceStream.file". I have not been able to open the files on my own.

I ask the help on a way of opening of these files. Thanks in advance to all for the help!

 
abo-nent:

Windows XP-3. Right-clicking on the audio file icons and then the "Properties" button reads: "File type: AceStream.file". I have not been able to open the files on my own.

I ask the help on a way of opening of these files. Thanks in advance to all for the help!

AceStream is a torrent file viewer.

Google is your guide.

 
Artyom Trishkin:

AceStream is a torrent file viewer.

Google it.

Thank you very much for your attention.

Google, I don't think, will save the situation. Audio files that have stopped opening for some unknown reason have nothing to do with torrent files, their type is positioned as AceStream.file. And what kind of extension is ".file"? This is the first time I've encountered such a thing. I don't know what to do. I only hope for a qualified help. Hope dies last. Don't let it die, people! Help me. Thank you all for everything.

 
abo-nent:

Thank you very much for your attention.

Google, I don't think, will save the situation. The audio files that stopped opening for some unknown reason have nothing to do with torrent files, their type is positioned as AceStream.file. And what kind of extension is ".file"? This is the first time I've encountered such a thing. I don't know what to do. I only hope for a qualified help. Hope dies last. Don't let it die, people! Help me. Thank you all for everything.

What files are you trying to open? What's their extension? What software do you have for watching video and playing audio? It feels like one of them reassigned the file type to itself and deflated...