How to read a text file and trade upon it?

 

I want to write an EA that reads a text file with contents like bellow and do automatic trading upon it. 

Name: stock_a

Range: 122 - 124

cost: 1000 

Type: buy

(IT means today buy the stock_a in prices between 122-124 with total volume of 1000 dollar for example). And the text file will be update everyday by another program(or maybe by hand).


Is it possible?

If so, how should I write it(let me know the steps or functions that I need. I don't know anything about EA programming!).

 

That is far too complicated for a beginner programmer.

You need to learn the basics before even attempting something like this.

 

Do not double post.

I have deleted your other post asking the same questions.

 
Keith Watford:

That is far too complicated for a beginner programmer.

You need to learn the basics before even attempting something like this.

I am not a beginner programmer! I have a proper experience in C++. But I am new on EAs.
 
rezaeee:
I am not a beginner programmer! I have a proper experience in C++. But I am new on EAs.
Show your code. Show what you have tried so far.
 
Anthony Garot:
Show your code. Show what you have tried so far.
I didn't do anything about EA systems so far and started to study. I only asked this question to know If is it possible in MQL5 language or not? (I don't know what compiler does this language use and what abilities does it have)
 
rezaeee:
I didn't do anything about EA systems so far and started to study. I only asked this question to know If is it possible in MQL5 language or not? (I don't know what compiler does this language use and what abilities does it have)

It is possible. Think of MQL5 as a tepid flavor of C++.

Start here: https://www.mql5.com/en/docs/files

 

Be aware that you may run into concurrency problems when running the Strategy Tester (ST) to optimize your parameters.

Each agent wants to access the same file, but only one agent will be able to read it, while the others fail. This results in the ST to stop silently without any error in the logs.


Besides that, I highly recommend you to wrap file related operations into a dedicated manager class, so your EA or indicator can easily create that manager and read or write any date you need.

Reason: