How to save and read from file multidimensional array
Created at 28 Oct 2019, 19:03
RA
How to save and read from file multidimensional array
28 Oct 2019, 19:03
Hi, How can I save and then read from file multidimensional array e.g [100,4]? I need this to not loose data (in array) when restarting robot. Is there any other way to not loose data when rebooting? Should I use txt or other file to save data from array and then read it by robot and use for trading?
firemyst
17 Aug 2020, 12:43
Serialize it to JSON, save the JSON to a text file.
Then when you restart and restart your bot/indicator, in the OnStart or Initialize methods, you can read the json back in and convert it back to a 2-dimensional array.
Example code:
@firemyst