Download MetaTrader 5
To add comments, please log in or register
Deposit to your account via PayPal
MetaQuotes Software Corp.
MetaQuotes Software Corp. 2016.07.19 14:39 

New article Using text files for storing input parameters of Expert Advisors, indicators and scripts has been published:

The article describes the application of text files for storing dynamic objects, arrays and other variables used as properties of Expert Advisors, indicators and scripts. The files serve as a convenient addition to the functionality of standard tools offered by MQL languages.

Let's examine the code fragments taken from the fully operational indicator. The indicator needs data on several currency pairs for proper operation. So, it requests data by timer and then processes it according to its logic (the indicator logic is of no importance for us here). Please remember that brokers sometimes add various suffixes and prefixes to symbol names (for example, EURUSD may be turned into This should be taken into account, so that the EA is able to refer to other symbols correctly. The sequence of our actions is as follows.

1. Create a text file broker.cfg with the following content: 

2. Create a text file <indicator_name>.cfg with the following content:
/*Number of currency pairs with the "anchor" string [CHARTNAMES] */
/*Names of the currency pairs, whose charts are used by the indicator to read the data*/
/*Position of a base currency in a pair (it is CAD in this case) – first or second*/

Author: Andrei Novichkov

To add comments, please log in or register