mtapi icon indicating copy to clipboard operation
mtapi copied to clipboard

MT5 Connect

Open gdreossi opened this issue 7 years ago • 4 comments

Hello, I am unable to connect to MT5 Client using the following code:

MtApi5Client mtClient = new MtApi5Client(); mtClient.BeginConnect(8228);

Is there something missing? Is there any way to get connection error message?

Using the ApiService I am able to connect and get quotes:

MTApiService.MtClient client = new MTApiService.MtClient(8228); client.Connect(); List<MTApiService.MtQuote> ff = client.GetQuotes();

Thank you.

gdreossi avatar Sep 26 '18 19:09 gdreossi

Do you have the same problems with the Test Client? (MtApi5TestClient.exe)

KptKuck avatar Sep 29 '18 15:09 KptKuck

same question here @KptKuck @gdreossi have you solved it?

guzuomuse avatar Nov 11 '19 04:11 guzuomuse

MtApi5Client has async function BeginConnect. For correct using the API you need to subscribe on event ConnectionStateChanged to get state of connection. When you receive state Mt5ConnectionState.Connected then you can use other functions like GetQuotes.

vdemydiuk avatar Mar 01 '20 16:03 vdemydiuk

Can you solve that? I'm having the same problem

AlexR1998 avatar Jul 12 '20 02:07 AlexR1998