i believe this code was the issue. isolated problem !!!
it is used in a while loop with a sleep sequence with 3 or 5 seconds. after about 1350 minutes - the script get blocked.
fileName = Symbol()+ "Detailed" + Period()+".csv"; // analiza pe fiecare symbol fileHandle = FileOpen(fileName,FILE_CSV|FILE_READ | FILE_WRITE); fileReport = "AllLogsReports"+".csv"; fileRHandle = FileOpen(fileReport,FILE_CSV|FILE_READ | FILE_WRITE); FileSeek(fileRHandle,0, SEEK_END); data = "DayofYear"+ "," + currentTime.day_of_year + "," + "Hour" + "," + currentTime.hour + "," + "Minute" + "," + currentTime.min; FileWrite (fileRHandle, data); fileDominance = "DominanceHistory"+".csv"; fileDHandle = FileOpen(fileDominance,FILE_CSV|FILE_READ|FILE_WRITE); FileSeek(fileDHandle,0, SEEK_END); data = "DayofYear"+ "," + currentTime.day_of_year + "," + "Hour" + "," + currentTime.hour + "," + "Minute" + "," + currentTime.min; //FileWrite (fileDHandle, data); FileSeek(fileHandle, 0, SEEK_END); // Write at the end of the file. FileClose(fileHandle); // inchidere fisier de lucru FileClose (fileRHandle); FileClose (fileDHandle);
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
i am unsure why my script gets blocked after ~21 hours.
it runs every 3 seconds or 5 minutes.
kindly please advise, especially if there is a way to debug and find where the code is getting blocked and potentially why !
One thought:
https://www.mql5.com/en/docs/predefined/_stopflag
The _StopFlag variable contains the flag of the mql5-program stop. When the client terminal is trying to stop the program, it sets the _StopFlag variable to true.
how can the client terminal trying to stop the program ? why ?
This example is terrifying :)) - could someone elaborate how this works ?
https://www.mql5.com/en/docs/basis/operators/for
or it may be because I use the Alert function instead of Comment ? and the window is crashing ??
My high level code structure looks like this (it has few thousands lines of code):