Reading and Opening File / What is the correct Path?

 
I have a problem with reading and Opening File.
I guess my Code is fine. The Problem is where the File is created, when i create one with

    int fileHandle = FileOpen("DasisteinTestFile.csv", FILE_WRITE );


Its Created and directly deleted after the test in

User\AppData\Roaming\MetaQuotes\Tester\XXXXX\Agent-127.0.0.1-3000\MQL5\Files

But when i copy my existing one. "Dasisteintest.csv" into that Folder, suddenly the file is gone and the programm throws an Error

int fileHandle = FileOpen("DasisteinTestFile.csv", FILE_READ );
or
int fileHandle = FileOpen("DasisteinTestFile.csv", FILE_READ | FILE_CSV );
Where Do i have to put the files? How can i define where they are created.

I also tested at first the path where it should be.
C:\Users\XXX\AppData\Roaming\MetaQuotes\Terminal\XXXXXXXXX\MQL5\Files
Documentation on MQL5: File Functions / FileOpen
Documentation on MQL5: File Functions / FileOpen
  • www.mql5.com
The function opens the file with the specified name and flag. Parameters file_name [in]  The name of the file can contain subfolders. If the...
 
RundesZweieck:
I have a problem with reading and Opening File.
I guess my Code is fine. The Problem is where the File is created, when i create one with


Its Created and directly deleted after the test in


But when i copy my existing one. "Dasisteintest.csv" into that Folder, suddenly the file is gone and the programm throws an Error

Where Do i have to put the files? How can i define where they are created.

I also tested at first the path where it should be.

Hello

in the MT5 editor click > File > Open Common Data Folder

Go to Files , paste your file there

Then your open flags should be FILE_READ|FILE_CSV|FILE_COMMON

 
Lorentzos Roussos #:

Hello

in the MT5 editor click > File > Open Common Data Folder

Go to Files , paste your file there

Then your open flags should be FILE_READ|FILE_CSV|FILE_COMMON



Thank you that works,

I have the problem of the csv. File that i contains from reading characaters like : "慐獳刻獥汵㭴牐景瑩䔻灸捥整⁤慐潹晦倻潲楦⁴慆瑣牯刻捥癯牥⁹慆瑣牯医慨灲⁥慒楴㭯畃瑳浯䔻畱瑩⁹䑄┠" as far as i can see in the debugger.
I tried already the BIN , ANSI and UNCICODE Flags... everytime the same wrong characters.

Can you help me with this as well?

Edit: Firstly the csv File looks like :

Pass    Result    Profit    Expected Payoff    Profit Factor    Recovery Factor    Sharpe Ratio    Custom    Equity DD %    Trades    AnzOpenStrats    AnzCloseStrats    mab_trend_l    mab_open_l    mab_Closing_l  
372    10092,35    92,35    46,175    28,48512    0,86051    0,19479    0    1,06    2    1    5    280    54    214    
I tried it with a txt file. But with my code i always go through the collums with my code.
EDIT - GOT IT -
 
Got it . Has to be ANSI and the file has to be saved as UFT-8 CSV
 
RundesZweieck #:
Got it . Has to be ANSI and the file has to be saved as UFT-8 CSV

great work