This happened last Tuesday. My EA had been running like clockwork on a VPS for six months. I decided to do a routine Windows update, rebooted the machine, and everything went sideways.
The EA loaded fine. No errors in the Experts tab. But when I opened the Strategy Tester to do some backtesting on the recent data, the chart showed nothing. Nada. The history center had data from 2024, but all the recent ticks were just gone. It was like the VPS had amnesia.
My first thought was the broker's server. Maybe they changed the symbols? I checked the symbol names, they were the same. I tried re-adding the symbol via "Market Watch" and even right-clicked to "Show All" — nothing. Then I went into "Tools" > "Options" > "Charts" and clicked the "Enable" button for "Show Offline" — still no change.
The real problem was deeper. I remembered reading somewhere on the MQL4 official docs (docs.mql4.com) about the directory structure for history files. There's a specific folder where the terminal stores compressed tick data:
\history\[server_name]\[symbol_name].hst.I remoted into the VPS and navigated there. The file was there, with a recent modified date! So the data was physically on the disk. But the platform wasn't loading it.
That's when I realized the issue wasn't the data — it was the index. After a forced reboot, the MT4 terminal's internal index for that symbol got corrupted. The file was fine, but the terminal didn't know where to look.
The official solution from the MetaQuotes Help Center (help.metaquotes.net) for corrupted history is to use the "History Center" tool to "Export" and "Import" data. But that's a long process. I found a faster workaround that I've been using ever since.
Here's what I did:
C:\ProgramData\MetaQuotes\Terminal\[Instance_ID]\history\[Server_Name]\..hst file for the symbol</strong> (e.g., EURUSD.hst) to a safe temporary folder..hst file</strong> from the history folder..hst file back</strong> into the history folder, overwriting the newly generated one. This forces the terminal to read your original file with the correct tick data, but now using the freshly generated index.I know this sounds like voodoo, but it works. It's effectively a manual "rebuild index" operation.
One more thing: if you're using a VPS with aggressive antivirus like Kaspersky (which I was), make sure to add the entire
C:\ProgramData\MetaQuotes\ folder to the antivirus's exclusion list. Kaspersky has a habit of quarantining the history files during a reboot, thinking it's a virus. I learned this the hard way after the reboot.The whole process took me about 15 minutes, but it saved me from having to redownload six months of tick data from the broker (which would have taken hours, given my VPS's connection speed).
Reference: MQL4 Documentation – "Working with the History Center" (docs.mql4.com)
---
This article was originally published on FXEAR.com. All rights reserved.