RSS feeds in the directory: 2798
Added today: 0
Added yesterday: 0
Good afternoon, friends!
Probably you need to copy the transaction from one of your terminal to another. For example, if you need to open the same position on different accounts or multiple brokers. Manually this work takes time, which you can save if entrust this routine task to the copier. In addition, the copier can be written by yourself.
Today we will learn how to create a simple trade copier for MT4. The process of copying the article is implemented through a shared file directory, so the same approach can be used to transmit any information between several terminals MT4/MT5 on a single PC.
the General idea
that's the Idea. All the terminals installed on the computer, have a common directory. In a shared directory, the Provider creates the file with all open positions. Terminal client reads data from a file and opens the desired position.
This approach is chosen because of its versatility and ease of implementation. But this is not a universal solution because in some situations the desired speed and large capacity, and the files can not provide. However, to copy the normal trade this would be sufficient.
the Main problem of all copiers – sync conditions. First and foremost, we need to somehow link a warrant to a customer order, open the provider. To do this, as the unique order ID (magic number) we will use the order ticket provider. The order ticket may change if was closed part of the position, and this case also need to be processed.
so the wizard writes all active positions in the file. The client then reads the data and creates its own copy of the file in the local directory. Thus, to work we need to create functions to read and write, with the ability to access shared and local catalogs.
In this implementation, the EA goes into an infinite loop until I get access to the file. Sharing the shared file is not provided. So we will get rid of the defective data that the customer may mistakenly be taken for a trade signal.
void write(string name,Params &a,bool local=false)
h=local ? FileOpen(name,FILE_WRITE|FILE_BIN) :
void read(string name,Params &a,bool local=false)
h=local ? FileOpen(name,FILE_READ|FILE_BIN) :
the names of the files are created in the initialization function. The name of the shared file is the same for all, as the name of the local backup uses the account number. Immediately call the backup method, which creates a local entry (yet empty) positions in the terminal folder.
basically, the method of “backup” creates a backup file through which we will then verify the changes in open positions.
there is Also the option to read from a file, which returns the number of stored positions.
int backup(Params &a)
There are methods for sharing of positions. “pull” to retrieve data on the positions of the common file, “share” to save changes to a shared file. In the “share” feature support multiple providers. To eliminate the conflict of multiple master accounts, trying to access one file, each provider identificireba the account number.
int pull(Params &a)
read(sharedName,orders); // read shared positions
// copy all the "wrong" order in a temporary array
Actual trading ideas and Analytics for 21.04.2017 21.04.2017 at 04:52
All the secrets Price Action patterns 20.04.2017 at 17:55
Trading forecasts and ideas on 20.04.2017 20.04.2017 at 04:31
Mid-term review of exchange rates Forex on 19.04.2017 18.04.2017 at 20:51
Relevant trade ideas on 18.04.2017 17.04.2017 at 20:38
A brief overview of the Forex market to 17.04.2017 16.04.2017 at 17:28
Indicator Kayman — alone against the crowd 15.04.2017 at 07:30
Forecast the movement of currency pairs on 14.04.2017 13.04.2017 at 21:11
Candlestick analysis Forex market on 13.04.2017 12.04.2017 at 21:07
The technical picture of the tools in Forex on 12.04.2017 11.04.2017 at 21:13