Errors, bugs, questions - page 3141

 

Oleg Pavlenko #:

Why does it work correctly in MQL4 without zeroing, but not in MQL5?

MQL4 zeroes everything by itself.

 
Oleg Pavlenko #:

Thank you!

It helped.

I do not understand one thing, why it works correctly in MQL4 without zeroing, but not in MQL5?

Because "the sheriff does not care about Indian problems".
:(
 
fxsaber #:

MQL4 will reset everything to zero by itself.

Is there a difference between ZeroMemory(array); and ArrayFree(array); for the array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);

 
Lilita Bogachkova #:

Is there a difference between ZeroMemory(array); and ArrayFree(array); for an array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);

ZeroMemory doesn't free memory, it only zeroes it.

 
fxsaber #:

ZeroMemory does not free the memory, it only resets it to zero.

thanks

 
Lilita Bogachkova #:

Is there a difference between ZeroMemory(array); and ArrayFree(array); for an array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);

I think there are some subtleties here. If the array's size is increased after ZeroMemory(array);, we may get "trash" in the array cells that are "behind". If you apply ArrayFree (array);, the "rubbish" may be located anywhere in the array.

So, it is possible to choose only by making some experiments in speed of these functions. And it is the programmer who decides about the "trash". If an array is filled with values right after declaration or resizing, what's the point of zeroing and then filling this array...

 
enum LIST
  {
   L01=111,   // ITEM 1
   L02=222,   // ITEM 2
   L03=333,   // ITEM 3
   L04=444,   // ITEM 4
   L05=555,   // ITEM 5
   L06=666,   // ITEM 6
   L07=666,   // ITEM 7
   L08=666,   // ITEM 8
  };

input LIST LISTING_01=L01;
input LIST LISTING_02=L02;
input LIST LISTING_03=L03;
input LIST LISTING_04=L04;
input LIST LISTING_05=L05;
input LIST LISTING_06=L06;
input LIST LISTING_07=L07;
input LIST LISTING_08=L08;

As far as I understand, all L0X in enum LIST {} are independent. However, as soon as we assign the same value (666) to some enum elements, the default comment stops displaying correctly, picking up comment (and apparently value, although it's hard to say, as they are the same and impossible to understand) from the first element with the same value (see last three linesin enum LIST {}) for some reason.

Worse, when trying to change the default display of line 7 from "ITEM 6" to "ITEM 7" and line 8 to "ITEM 8" in Program Settings, whichare originally in the code comments, they are persistently knocked back to"ITEM 6":

Settings

 
Does the CPU or GPU handle the indicator buffers? What should I upgrade to make it render faster? Of course, it's about the hardware, since OpenCL, I suspect, won't help here.
 

There's a typo here


 
Hi all, Can you give me a hint? MT5 in the balance is constantly some kind of calculations is incomprehensible. It adds and subtracts. The balance is constantly changing. Because of this, the risk manager just works ***. The broker is an opener. Section futures market. On the themes do not have time to browse. Throw the link if there is such a question already. I have no time for that. Thank you!
Reason: