It is very unreasonable to create a T structure for packing data, when each unpacked element of the MqlTick array will correspond to one packed element of the T structure array. Packed data - for maximum density and performance should be a set of several data arrays (and ideally bit arrays) and a set of several index arrays (also bit arrays). Packing, as well as unpacking is a continuous sequential recurrent process from zero to the last index. Ideally, on average,4 bytes will be enough for one 60byte MqlTick structure.I.e. 15 times packing. This is confirmed by the size of tkc files . And it seems to be the limit. It is very strange why M1 MqlRates data (hcc files) are still not packed!!! I doubt that downloading and unpacking a packed file from an SSD drive would take longer than downloading an unpacked file that is say 5-6 times the size of the packed one.
voidOnStart()
{
ushort Num = 0;
Print(typename(Num >> 1)); // int ?!
Num >>= 1; // A double conversion is done here: ushort -> int -> ushort?
Num = Num >> 1; // Why isn't there a warning that a signed int goes to unsigned ushort?
}
Why does a bitwise operation lead to the creation of an int-variable?
How to do bitwise operations cheaply?
fxsaber operations.
Is this correct?
voidOnStart()
{
int Num = -1;
Print(Num >> 8); // -1
}
Yes, the shift is arithmetic, the code is additional.
0xFFFFFFFFFFFF no matter how much you shift it, 0xFFFFFFFFFFFF will remain.
Если же сдвигаемое значение имеет знаковый тип, то осуществляется арифметический сдвиг вправо, то есть освобождающиеся слева разряды будут заполняться значением знакового бита (если число положительное, то значение знакового бита равно 0, если число отрицательное, то значение знакового бита равно 1)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I need a fast decompression of the compressed MqlTick. This option is unfortunately slow.
See my example here https://www.mql5.com/en/forum/349798/page2#comment_27766871
fxsaber #:
MqlTick
It is very unreasonable to create a T structure for packing data, when each unpacked element of the MqlTick array will correspond to one packed element of the T structure array.
Packed data - for maximum density and performance should be a set of several data arrays (and ideally bit arrays) and a set of several index arrays (also bit arrays). Packing, as well as unpacking is a continuous sequential recurrent process from zero to the last index.
Ideally, on average, 4 bytes will be enough for one 60 byte MqlTick structure. I.e. 15 times packing. This is confirmed by the size of tkc files . And it seems to be the limit.
It is very strange why M1 MqlRates data (hcc files) are still not packed!!! I doubt that downloading and unpacking a packed file from an SSD drive would take longer than downloading an unpacked file that is say 5-6 times the size of the packed one.
Each unpacked element of the MqlTick array will correspond to one packed element of the T structure array.
That is, you can pack not just one MqlTick array element, but several at once.
I.e. in general this condition.
But with such an uncomplicated initial formulation, people immediately fall away because of the long understanding.
I need a fast decompression of the compressed MqlTick. This option is unfortunately slow.
Try rounding to 5 digits instead of 8, to avoid tiny round-off errors:
Try rounding to 5 digits instead of 8 to avoid tiny rounding errors:
Yes, in that context, the digit matters.
Why does a bitwise operation lead to the creation of an int-variable?
How to do bitwise operations cheaply?
Is this correct?
Uploaded to this thread as it is autotranslate.
Is that correct?
Yes, the shift is arithmetic, the code is additional.
0xFFFFFFFFFFFF no matter how much you shift it, 0xFFFFFFFFFFFF will remain.
https://www.mql5.com/en/docs/basis/operations/bit
Why does a bitwise operation lead to the creation of an int-variable?
No explanation!
The bug (?!) shows in the intermediate results ONLY (for all bitwise operators).
However, assignment (Num >>= 1) works as expected, (luckily).
Yes, the shift is arithmetic, the code is optional.
0xFFFFFFFFFFFF no matter how much you shift it, 0xFFFFFFFFFFFF remains.
https://www.mql5.com/en/docs/basis/operations/bit
Thanks, missed it when reading the help.