You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Here is a code snippet to find out how fast a code is executed.
Actually now I have to start some experiments. So, in order to make a plan before I will start, would like to ask, which formats have good potential for optimal read write dynamic array, including strings.
As far as I can see so far, TXT, CSV and JSON ar good candidates.
Instead of asking, experiment for yourself and find out!
If you will have to choose, which format would you prefer to read/write dynamic array including string, TXT, CSV or JSON as recommended by Dominik?
None of the above! I would choose to use a packed binary format.
Packed binary is just binary data packed sequential in way that is not byte aligned to anything, so there is no space between data.
There are already examples in the documentation using packed binary data, such as the example at "FileWriteDouble()" or "FileWriteLong()".
Also, instead of your 2 dimensional array, create an array of a structure and simply use the FileWriteArray(), but remember to first output the size of the array, with FileWriteIntger(), so that you can dynamically adjust when reading it back.
EDIT: The array size is only needed in the case that you output other data to the file! If you only output the single array to it, then there is no need to save the size to the file as MQL will automatically adjust the size of a dynamic array for it when reading it. See the example FileReadArray().
Also, instead of your 2 dimensional array, create an array of a structure and simply use the FileWriteArray(), but remember to first output the size of the array, with FileWriteIntger(), so that you can dynamically adjust when reading it back.
In my case, structure two dimensional dynamic array contains strings. Is bin compatible format?
No. Read the documentation please.