vdemydiuk / mtapi

MetaTrader API (terminal bridge)
http://mtapi4.net/
MIT License
521 stars 281 forks source link

Fail to connect to the Host! #164

Closed michealChin closed 5 years ago

michealChin commented 5 years ago

Hi,

First Question:

I try to connect to my broker, if I understand the API correctly, the Host should be the IP address of my broker. I manage to get the broker's IP address through the metaTrader5 application from the netstat -nof. The IP is 104.41.54.220:443, so I assume the Host = 104.41.54.220 and Port = 443, however I always got the following error message

Connection failed to service. The server at net.tcp://104.41.54.220:443/MtApiService rejected the session-establishment request.

Second Question: Can I connect to the broker directly by specifying the broker name without specifying the IP address and Port number just like how metaTrader5 did.

Thanks!

michealChin commented 5 years ago

I manage to get it work.

mitnick2012 commented 3 years ago

how did you fix that please ?

KptKuck commented 3 years ago

how did you fix that please ?

Connections to MetaQuotes servers are not supported- The connection must be to host with a terminal Readme

mitnick2012 commented 3 years ago

yes Im using metatrader in localhost and also I get this error in localhost : Connection failed to service. Could not connect to net.tcp://localhost:8222/MtApiService. The connection attempt lasted for a time span of 00:00:04.0131287. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8222.

eabase commented 3 years ago

Did you open your firewall port? Did you try using 127.0.0.1 for IP?