The MQL code will be stopped when metatrader is closed.
You need an external program (not MQL) to implement this.
But I suggest instead of implementing this, don't close the metatrader when you don't want the metatrader to be closed.
The MQL code will be stopped when metatrader is closed.
You need an external program (not MQL) to implement this.
But I suggest instead of implementing this, don't close the metatrader when you don't want the metatrader to be closed.
But sometimes this is unavoidable due to power fluctuations
I would prefer to place the advisor on VPS and sleep peacefully.
Even if you implement automatic launch of metatrader, it will still be much worse than VPS.
Yes VPS is best.
But if you really, really want such a feature, I guess you could write the original start time of the EA to a file - or just note it manually.
If you want to use MQL5, using functions like GetTickCount64() & GetMicrosecondCount() you may be able to compare and figure it out. Please refer to the documentation for these
If you want to do it at OS level you can use uptime in Linux, or for Windows there are various methods:
https://www.windowscentral.com/how-check-your-computer-uptime-windows-10
But you could also install GitBash or some similar Unix emulator for Windows and use the uptime command there also I guess- 2022.09.27
- www.windowscentral.com
Yes VPS is best.
But if you really, really want such a feature, I guess you could write the original start time of the EA to a file - or just note it manually.
If you want to use MQL5, using functions like GetTickCount64() & GetMicrosecondCount() you may be able to compare and figure it out. Please refer to the documentation for these
If you want to do it at OS level you can use uptime in Linux, or for Windows there are various methods:
https://www.windowscentral.com/how-check-your-computer-uptime-windows-10
But you could also install GitBash or some similar Unix emulator for Windows and use the uptime command there also I guessI have use GetMicrosecondCount() , but i don't know why it dosen't work for offline chart
Yes VPS is best.
But if you really, really want such a feature, I guess you could write the original start time of the EA to a file - or just note it manually.
If you want to use MQL5, using functions like GetTickCount64() & GetMicrosecondCount() you may be able to compare and figure it out. Please refer to the documentation for these
If you want to do it at OS level you can use uptime in Linux, or for Windows there are various methods:
https://www.windowscentral.com/how-check-your-computer-uptime-windows-10
But you could also install GitBash or some similar Unix emulator for Windows and use the uptime command there also I guessyou are right and vps is best,
I am trying to solve this problem for when there is no VPS, I have used the GetMicrosecondCount() function and it shows me if the meta is restarted.
I have asked it to read data if the time of this function is less than 5 seconds from my file (it is stored in the necessary data file)
but it does not do this for offline data!!!
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use