mql4-lib icon indicating copy to clipboard operation
mql4-lib copied to clipboard

Save and load Vector from disk

Open rotem443 opened this issue 6 years ago • 3 comments

Hey, I'm using the Vector with customized class, is there any way to save and load the vector to the disk? Thanks

rotem443 avatar Nov 23 '18 07:11 rotem443

Thanks for your interest. Currently there is no systematic way to serialize objects to disk. You have to do it by yourself. In the future, this might be added to the framework.

dingmaotu avatar Nov 23 '18 10:11 dingmaotu

Thanks for your interest. Currently there is no systematic way to serialize objects to disk. You have to do it by yourself. In the future, this might be added to the framework.

Thanks for the fast response. What is the best way you can think about for implementing this for now?

(this is my problem - https://www.mql5.com/en/forum/291484#comment_9467524)

rotem443 avatar Nov 23 '18 10:11 rotem443

Hi, you can check out the serialization format supported in the mql4-lib:

  1. CSV file is the simplest, you can use CsvFile class in Util/File.mqh
  2. Format/Resp.mqh or Format/Json.mqh and save the result to a BinaryFile.

Json format is not production ready though.

dingmaotu avatar Nov 28 '18 13:11 dingmaotu