muserfish: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 - That's not the problem, that's the symptom. You must decide what you need to do at max size. Stop, make it a queue, make it a circular buffer, delete and restart, etc.
- Until you decide in concrete terms, no one can help you. The terms come from how you use the data.
William Roeder:
Thanks William. I did edit the original post.-
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 - That's not the problem, that's the symptom. You must decide what you need to do at max size. Stop, make it a queue, make it a circular buffer, delete and restart, etc.
- Until you decide in concrete terms, no one can help you. The terms come from how you use the data.
As per regards to points 2 and 3, my fault I did not specify. A circular buffer is what im looking for.
Example: Maxsize = 5;
A, B, C, D, E is the data in the file and subsequently in the array. Once maxsize is reached, which in this case it has, it keeps storing next data in the file and eliminating the bottom (oldest) data.
so next ticks:
B, C, D, E, F
C, D, E, F, G etc etc.
Allowing the lines in file to be alway at Maxsize.
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
Dear all,
My limiting knowledge of programming is giving me a hard time with the piece of code below:
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.