MetaQuotes Language Editor deleted part of my code by itself

 

How do I fix this, and what’s the reason behind it?

Recently I ran a few tests on my MT5 code, and when I opened MetaEditor to make changes, the program automatically deleted parts of the code. It happened not just in one file, but in several

 
Sergiu Luzov:

How do I fix this, and what’s the reason behind it?

Recently I ran a few tests on my MT5 code, and when I opened MetaEditor to make changes, the program automatically deleted parts of the code. It happened not just in one file, but in several

Wow! That's catastrophic. All that I can think is that, somehow, your MetaEditor installation got corrupted. Just to be safe, I would backup your entire MQL5 folder and then completely reinstall MT5.

You might even want to run a malware/virus scan first.

 
Sergiu Luzov:

How do I fix this, and what’s the reason behind it?

Recently I ran a few tests on my MT5 code, and when I opened MetaEditor to make changes, the program automatically deleted parts of the code. It happened not just in one file, but in several

this has happened to me several times, but i have mentioned it several times, but no one cares because it is not replicatable.

I assume it is to do with windows and its cache. if sudden shutdown happens it can happen, however a few other times it has also happened on a correct shutdown such as shutting down editor and mt5 before shutting down windows.

I am sorry  but so long as devs and moderators dont "give a s#$%& then nothing is going to happen to prevent this from happening again. i recommend that you do as i do: make automatic backups of all files EXTREMELY FREQUENTLY.

Note that a former moderator also mentioned it in a thread years ago. But since it wasnt replicatable, nothing "come of it".
 
You might want to try Windows File Recovery before you shut down.
 
Ryan L Johnson #:
You might want to try Windows File Recovery before you shut down.

the thing is ryan, there is 2 or more copies of NTFS file table, but those tables 2nd and higher is often not updated til windows has already shut down. Other programs will monitor this behavior, and check if its program has had its files updated and if not, then requests windows to do it again, however i think that it is obvious that mt4/5 does not do this.

And upon windows starting up, then it will often do a check of ntfs tables, and if there is only 1, then, it might assume that there is some error, and deletes 1 or more tables, which automaticly renders newer tables and files and recent modifications mute. does not happen often, but still -- too often.

 

Recently, I encountered a very similar situation.

I was working on an update and adding several new functions. After compiling the utility, everything seemed fine—the new function had been tested and was working correctly.

I then saved the source file in my projects folder, compiled it again, and uploaded the new version to the server. However, after checking the version on the server, I discovered that the function from my latest changes was missing, as if it had never been saved.

I investigated the issue and found that the same thing had happened with several of my Expert Advisors.

I added the missing function again, but this time I saved the file using a slightly shorter filename. After that, everything appeared to work correctly.

Therefore, I recommend checking the filename and making sure it is not too long. This may be the same issue—or perhaps I experienced exactly the same problem as the original author.

 
Michael Charles Schefe #:

this has happened to me several times, but i have mentioned it several times, but no one cares because it is not replicatable.

I assume it is to do with windows and its cache. if sudden shutdown happens it can happen, however a few other times it has also happened on a correct shutdown such as shutting down editor and mt5 before shutting down windows.

I am sorry  but so long as devs and moderators dont "give a s#$%& then nothing is going to happen to prevent this from happening again. i recommend that you do as i do: make automatic backups of all files EXTREMELY FREQUENTLY.

Note that a former moderator also mentioned it in a thread years ago. But since it wasnt replicatable, nothing "come of it".

Please watch your language and do not make free assumptions. It is not true that no one cares. Though, I will not fight to get technical information which no ones of the 4 participants to this thread gave.

What thread(s) are you referring to ? What config ? 

Is Git storage used ?

 
Alain Verleyen #:

Please watch your language and do not make free assumptions. It is not true that no one cares. Though, I will not fight to get technical information which no ones of the 4 participants to this thread gave.

What thread(s) are you referring to ? What config ? 

Is Git storage used ?

this isnt my thread alain so i wont hijack it. if you want to discuss it with me more then we can do it in dm. because i reported mine twice in the past and both threads were deleted due to my issue not showing proof or being unreplicatable.
 
Michael Charles Schefe #:
this isnt my thread alain so i wont hijack it. if you want to discuss it with me more then we can do it in dm. because i reported mine twice in the past and both threads were deleted due to my issue not showing proof or being unreplicatable.

If you want to provide more details you know how to contact me.

I am not aware of any thread deleted about such issue.

 

Take this with a grain of salt because I only found 2 MT4 threads in the Forum on-point. Assuming that the cause(s) could be similar in MT5, here are the threads.

1. Former Moderator, Fernando, regarding memory/file corruption:

Forum on trading, automated trading systems and testing trading strategies

My code has all of a sudden disappeared

Fernando Carreiro, 2023.12.06 16:21

Yes, it happened to me twice at very different times.

In both cases, the affected files were those that I had open in MetaEditor at the time, and their content had been completely wiped (filled with null characters).

I suspect that in both cases there was memory or file corruption caused by a malfunctioning MetaEditor.

However, it did not affect me much as I keep regular backups and simply restored the files after first restarting my computer.

2. Another user, regarding a full hard drive:

Forum on trading, automated trading systems and testing trading strategies

"Event handling function not found". You could lose your code if you don't have a backup!

dc3463456, 2023.06.15 22:34

Warning to anyone. If you encounter the error "event handling function not found", it could be because your hard drive is full.

Even after freeing 10GB of space, I was still getting the same error when trying to compile my indicator.

So I restarted MetaEditor and now the source file is completely blank and the ex4 doesn't work.