My limiting knowledge of programming is giving me a hard time with the piece of code below:
double PriceDiff = MarketInfo("AUDCAD",(MODE_ASK));
int fileHandle2 = FileOpen("Myfile.bin",FILE_BIN|FILE_READ | FILE_WRITE);
FileSeek(fileHandle2, 0, SEEK_END); // Write at the end of the file.
double data2 = PriceDiff;
string path= "";
//--- receive the array size
//--- print data from the array
Comment("Total data = ",size);
//--- close the file
The above, most of which taken from online sources and adapted to my needs, is simply storing tick price data into a bin file (on every tick) and closing file.The next paragraph opens that file and puts that data into an array to be used at a later stage.The problem is that this way the file just keeps on getting larger and larger. Am not sure how to solve it and limit the file to a max of 1000 ticks, for example.
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.) General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06 Messages Editor