Mt5 gateway have two components
- Fix Gateway
- Webservice Api
Fix gateway responsible for cmd and stream commands
Web service api responsible for query commands
- Install both vc_redist.x64_2017 and vc_redist.x64_2013 on the server you want as a gateway. if you need 32 bit , install the x86 version. (You can find the installtions in /vc folder)
- Copy the Api and Fix (with the related x86 or x64)
- Put all the configuration files (see below) in the relevant folders
- Run the apps directly ( might need Run as Administrator) or run it with -i <service_name> to create a service
IMPORTANT: MAKE SURE THAT MT5WebAPI.lic and FIXAPI.MT5.lic ARE COPIED TO
Session Configuration file example: file name: sessions.cfg
[DEFAULT]
ConnectionType = acceptor
UseDataDictionary = Y
DataDictionary = fix/FIX44.xml
StartDay = Sun
StartTime = 00:00:00
EndDay = Sat
EndTime = 23:59:59
ValidateFieldsOutOfOrder = N
ValidateUserDefinedFields = N
ValidateFieldsHaveValues = N
ResetOnLogon = Y
ResetOnLogout = Y
ResetOnDisconnect = Y
CheckLatency = N
PersistMessages = N
BeginString = FIX.4.4
HttpServer = http://hots:port/
[SESSION]
SocketAcceptPort = 13001
SessionType = Trade
SenderCompId = mt5t
TargetCompId = manager
LogMessages = Y
[SESSION]
SocketAcceptPort = 13002
SessionType = Quote
SenderCompId = mt5md
TargetCompId = manager
LogMessages = N
Notes:
- Two sessions should be configured:
- Market data - rates
- Trade - trading commands Set only the SocketAcceptPort
- httpServer - provide an http interface to fix settings. set the host and the appropriated port. please pay attention that the host should match the host name for the DNS
- The port and the address of this app should be exposed to Tradency in order to connect
config file for connection to MT5 manager API file name config.json
{
"Credentials": {
"Server": "host:port pf MT5 server",
"Login": mt5-account-login,
"Password": "mt5-login-password",
"PasswordCert": null,
"ConnectionTimeout": 30000
}
}
- Set the server:port
- Login is the MT5 manager login
- Password is the MT5 manager password
IMPORTANT: BOTH FILES SHOULD CONFIGURE
File name: MT5WebAPI.json
{
"Binding": {
"Url": "http://hots:port"
},
"MT5": {
"Server": "host:port of MT5 server",
"ConnectionTimeout": 30,
"StoreTime": 0
}
}
- Set the binding for listen API. it's important that the host should match the DNS name
- Set the server host:port of the MT5
- This is a Web server for API, from one end it connect to MT5 and expose rest API
- The server host:port should be exported to Tradency in order to connect
- In order to verify that the configuration is OK, browse to http://host:port/swagger