File (Read data or values from Files):

Suppose you have some data or values created by another application or another expert. If you want to use those data in ESB, you can import them using the File indicator. The parameters of this indicator are as below:

[FILE] Read from FileFilename, separator, encodingExamples: Abc.txt Abc.txt,comma,ansi ABC.txt,-

FileName: This parameter is the name of the file for example “abc.txt”. ESB supposes that the file exists in the ‘MQL\Files’ path of the MetaTrader. You can set also a path. for example, “Dir1\abc.txt” that ESB will try to load it from ‘MQL\Files\Dir1\abc.txt’

Separator: This is an optional parameter that says how data are written in files and how ESB can understand them. By default, it is a comma. For example, if the “abc.txt” file has the data like this:


You can set parameters like “abc.txt, comma”  that means number are separated by a comma.

If shift is 0, ESB will return 100, if shift is 4, ESB will return 485 and so on.

For this data:


Can be set by “abc.txt,-” which means data has to be read from abc.txt and numbers are separated by “-“.

The last thing about reading from files is; ESB can read each value from a new line. Image the file content is:


In this case for set parameters, filename is enough, and no need to set separator. ESB considers each line a separate value. For example, if you set a shift of the indicator on 4, it returns 485.

Encoding: you can set also encoding of the file that could be ANSI or UNICODE. By default, ESB uses ANSI.