
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
Hi MQL5 Community,
I'm working on a script that involves reading an exchange rate from a file to perform risk calculations before opening trades. Unfortunately, I'm encountering an issue with opening the file and getting the following error:"Failed to open exchange_rate.txt file, Error code = 5002"
This error is causing problems in my trade execution because I need the exchange rate to calculate the capital at risk in local currency.
Here is the relevant part of my code:
I also use the exchange rate in my trade calculations as shown below:
Error Details:
Things I Have Checked:
Could someone please help me understand what might be causing this error and how to resolve it?
Any guidance on resolving this file opening issue or any suggestions for improving the overall approach would be greatly appreciated.
credit of partial code built upon and obtained from codebase docs.mql4.com
Thanks in advance for your help!
Kind Regards,
Benjamin