Please search before you post ... https://www.mql5.com/en/search#!keyword=Error%205002&module=mql5_module_forum
ERR_WRONG_FILENAME
5002
Invalid file name
Check your filename (and in your case broker name) for any invalid characters that are not allowed, such as colon ":", etc.
Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.
The code used to work, and all of a sudden started printing that error.
Any assistance would be appreciated
Please search before you post ... https://www.mql5.com/en/search#!keyword=Error%205002&module=mql5_module_forum
ERR_WRONG_FILENAME
5002
Invalid file name
Check your filename (and in your case broker name) for any invalid characters that are not allowed, such as colon ":", etc.
Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.
Follow up as suggested ...
- "Check your filename (and in your case broker name) for any invalid characters that are not allowed, such as colon ":", etc."
Did you do that? Did you print out the file name to the log file and verify it? - "Please search before you post".
Did you do that? Did you read the other threads for possible similarities and clues?
Also, does the file perhaps already exist? Is it perhaps "locked" because it is open in another application?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys, I've been getting this error on my expert advisor when writing to csv file. Below is my code.