Read a csv file from the strategy tester

bodojan468
58
bodojan468  

Hello,

I'm trying to read a value from a csv file. Everything works fine  when I attach the EA on a chart. The problem is only with the strategy tester.

As per the documentation : The file is opened in the folder of the cli ent terminal in the subfolder MQL5\files (or testing_agent_directory\MQL5\files in case of testing).

I tried to put the files in AppData\Roaming\MetaQuotes\Terminal\XXXXXXXXXXXXXXXX\Tester\Files or AppData\Roaming\MetaQuotes\Terminal\XXXXXXXXXXXXXXXX\testing_agent_directory\MQL5\files but I always got the same error (error code 5004).

I also use the following directive in mycode :

#property tester_file "testfile"


Obviously there is something that I don't understand.

My question is what or where is  testing_agent_directory\MQL5\file directory. 

Can someone help me locate the folder please

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
bodojan468
58
bodojan468  

Hi,

Finally, I found  the good path for the file by using this

TerminalInfoString(TERMINAL_DATA_PATH)

I find that there is a lot of lack in the MQL5 documentation or it is not intuitive. Hope this can help

https://www.mql5.com/en/docs/check/terminalinfostring

Documentation on MQL5: Checkup / TerminalInfoString
Documentation on MQL5: Checkup / TerminalInfoString
  • www.mql5.com
TerminalInfoString - Checkup - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5