EMIR
This is a tool to generate and send trade reports to the UnaVista repository. It is compatible with both MT4 and MT5.
For connecting to MT4 it uses a MySQL database created by the MetaQuotes Report Server, with a few additional tables. You will need to install another tool, Extended Replication.
For connecting to MT5 it uses the MetaQuotes MT5 WebAPI.
Quick installation guide
First of all, you will need to install Microsoft .NET Framework 4.5.1 on your server.
Installation is simple: download and unpack the package to any folder on your PC.
Then you will need to obtain the MetaQuotes.MT5WebAPI.dll file (at least build 1325) and place it in the application's folder. We have no rights to distribute this file.
Next, deploy the Extended Replication tool and make sure your MySQL database contains these tables: mt4_trades and mt4_symbols.
After that, adjust the settings to fit your needs. You will find the file CPlugin.EMIR.exe.config, the main settings file.
The most important part of CPlugin.EMIR.exe.config is below:
<connectionStrings>
<add name="mysqlConnection" connectionString="server=mysql.server.com;uid=login;password=***;database=mt4_reports" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<userSettings>
<CPlugin.EMIR.Properties.Settings>
<setting name="LEI" serializeAs="String">
<value>213800....</value>
</setting>
<setting name="ftp_server" serializeAs="String">
<value>sftx.londonstockexchange.com</value>
</setting>
<setting name="ftp_port" serializeAs="String">
<value>22</value>
</setting>
<setting name="ftp_login" serializeAs="String">
<value>login</value>
</setting>
<setting name="ftp_password" serializeAs="String">
<value>***</value>
</setting>
<setting name="ftp_outgoing" serializeAs="String">
<value>/Outgoing</value>
</setting>
<setting name="ftp_incoming" serializeAs="String">
<value>/Incoming</value>
</setting>
<setting name="platform_server" serializeAs="String">
<value>mt.server.com</value>
</setting>
<setting name="platform_port" serializeAs="String">
<value>1970</value>
</setting>
<setting name="platform_login" serializeAs="String">
<value>1000</value>
</setting>
<setting name="platform_password" serializeAs="String">
<value>***</value>
</setting>
<setting name="client_server_prefix" serializeAs="String">
<value>MT5Test</value>
</setting>
<setting name="platform_type" serializeAs="String">
<value>MT5.WebAPI</value>
</setting>
<setting name="report_prefix" serializeAs="String">
<value>companyName</value>
</setting>
</CPlugin.EMIR.Properties.Settings>
</userSettings>
Settings explained:
LEI— your company's LEI code.ftp_server— UnaVista FTP server address.ftp_port— UnaVista FTP server port.ftp_login— UnaVista FTP server login.ftp_password— UnaVista FTP server password.platform_type— one of two supported types:MT4.MySQLorMT5.WebAPI.platform_server— your MT4/MT5 server address.platform_port— your MT4/MT5 server port.platform_login— your MT4/MT5 server login.platform_password— your MT4/MT5 server password.client_server_prefix— your server alias, used in reports to identify trades and the relying party. Usually UnaVista defines this prefix and tells it to you (for instance,MT4Real). Use alphanumeric characters only — no spaces allowed.report_prefix— report file prefix, used to uniquely identify reports. Something that uniquely identifies your server — useful when you have several of them reporting simultaneously. For example, a company name such asForexCorp. Use alphanumeric characters only — no spaces allowed.
Running
UnaVista provides PROD (real) and UAT (test) environments. At the beginning it is recommended to use UAT.
When you run the .exe file you can choose one or more features to execute. Add any of these parameters to the command line:
-file— connect to the MT4/MT5 server, get the data and generate the report file.-push— connect to the UnaVista FTP server and upload the generated CSV file.-pull— connect to the UnaVista FTP server and download the response CSV files.
For example, to generate a report, upload it and fetch the latest response files from UnaVista:
CPlugin.EMIR.exe -file -push -pull
You will find the application's journal under the .logs sub-folder.

