Errors, bugs, questions - page 2912

 
Kira27:

Thank you very much!!! Where can I read about it?

I found it))) --- Each graphical object must have a name unique within onegraph, including its sub-windows. Changing the name of a graphical object generates two events: the first is the event of deleting the object with the old name and the second is the event of creating a graphical object with a new name. The question is why complicate the programmer's life so much?

Операции с графиками - Справочник MQL4
Операции с графиками - Справочник MQL4
  • docs.mql4.com
Функции, устанавливающие свойства графика, фактически служат для отправки ему команд на изменение. При успешном выполнении этих функций команда попадает в общую очередь событий графика. Изменение графика производится в процессе обработки очереди событий данного графика. По этой причине не следует ожидать немедленного визуального обновления...
 
Konstantin Seredkin:

Who has encountered this

Vin 10

Terminal build 2715.

After I've done any optimisation of the Expert Advisor, after I close the terminal, Agents are still hanging in processes, consuming RAM.


Like not critical RAM volume is a lot, but when I run the game, because of the fact that the memory is constantly referring to a bunch of laggards I have FPS drops by at least 20 frames.

I have to either overload the computer or sit one process at a time to kill...

Honestly already starting to get annoying.

Tell me this bug or so designed, except for the terminal from the broker the opening has not put anything else, from time to time it is updated, any or manipulations with it did not do.

Agents are waiting a few minutes for the next tests to work out the tasks faster.

Automatically unloaded after a few minutes of inactivity.

 
Aleksei Lesnikov:
Thanks, that's an option!
What if the range is several thousand, or even tens of thousands of numbers?

this option shuffles randomly through an array of any size up to 1 073 741 824 as quickly as possible.

void OnStart() {
   int i1[]= {1,2,3,4,5,6,7,8,9,10,11,12,13};
   ArrayPrint(i1,0);
   MixArray(i1);
   ArrayPrint(i1,0);

   string str ="abcdefghijklmnopqrstuvwxyz";
   Print(str);
   uchar c[];
   StringToCharArray(str,c);
   ArrayResize(c,ArraySize(c)-1);
   MixArray(c);
   str=CharArrayToString(c);
   Print(str);
}
//+------------------------------------------------------------------+

template <typename T>
void MixArray(T &arr[]) {
   int size = ArraySize(arr);
   for (int i=0; i<(size-1); i++) {
      T temp = arr[i];
      int j=(rand()<<15|rand())%(size-i);
      arr[i]=arr[i+j];
      arr[i+j]=temp;
   }
}

result:

2020.11.28 20:24:09.009 MixArray (EURUSD,M6)     1  2  3  4  5  6  7  8  9 10 11 12 13
2020.11.28 20:24:09.009 MixArray (EURUSD,M6)     2 11  4  9 10  1  8  7  5  6 13  3 12
2020.11.28 20:24:13.114 MixArray (EURUSD,M6)    abcdefghijklmnopqrstuvwxyz
2020.11.28 20:24:29.322 MixArray (EURUSD,M6)    rhxuwjlyzkobpcvnefdmqasitg
 
MetaQuotes:

Agents wait a few minutes for the next tests to work through the tasks more quickly.

Automatically unloaded after a few minutes of inactivity.

I have them all the time until I unload them myself, when I made the screenshot, using MT5 was finished on Saturday morning when the market closed in my time zone, on Sunday I sat down to play games and started killing processes.

Probably the problem is on my side, even though I reinstalled the license a month ago.

 
Nikolai Semko:

this option shuffles randomly through an array of any size up to 1,073,741,824 as quickly as possible.

result:



Thank you!
 
Alexey Viktorov:

Because when an object is renamed, it is recreated. One is deleted, the other is created and in the list of all objects they are arranged in order of when they were created.

Please correct me if I got it wrong)))

When you change the name of a null object, it is deleted and re-created to be the last in the list (3)? And in 4 integrations of selecting objects in order in the list, will they line up in their original state? ?

 
Kira27:

Please correct me if I got it wrong)))

When you change the name of a null object, it will be deleted and re-created as the last object in the list (3)? And in 4 integrations of selecting objects in order in the list, they will line up in their original state?

What prevents you from checking?

 
Alexey Viktorov:

What prevents you from checking?

I did, before writing to make sure I understood you correctly, because the result of the object selection check is still the same

 
Kira27:

I checked before writing to make sure I understood you correctly, because the result of checking the selection of objects is still the same.

Although I have now closed the terminal and the editor, opened it again, ran the code 2 times and all is normal, the selection is correct. I noticed that sometimes I need to reload the editor for correct code processing, what is it about?

 
Kira27:

I checked before writing to make sure I understood you correctly, because the result of the object selection check is still the same

You don't need to understand me, you need to understand the documentation. I suggested sorting on the basis of a list of orders or positions. And in one of the threads Slava said that it is sufficient to simply hide the object and display it again, so it would be above all others and would get the "rat's click" event first. If wrong, sorry. Figure out how the list is sorted and tell everyone. I'll change my mind too.