int file=FileOpen("hist0935.csv",FILE_WRITE|FILE_CSV); for(int i=OrdersHistoryTotal()-1; i>=0; i--) { int file=FileOpen("hist0935.csv",FILE_WRITE|FILE_CSV);
- You open the file but don't check for an error What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Then you try to open the file again, which fails. And you've lost the handle so you can't ever close it.
- Open once. Wight your data in the loop. Close after the loop.
WHRoeder:
Thank you.
- You open the file but don't check for an error What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Then you try to open the file again, which fails. And you've lost the handle so you can't ever close it.
- Open once. Wight your data in the loop. Close after the loop.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I am getting an error message while attempting to write to a file location.
0 16:13:12.522 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
0 16:13:12.523 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
0 16:13:12.525 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
0 16:13:12.526 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
0 16:13:12.529 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
0 16:13:12.530 HL GBPCHF,Daily: Alert: hist0935 Events File Error.5004
Can somebody please help?