MT5 Realtime quotes

easy direct connection to any MT4 and MT5 server

MT5 Realtime quotes

This code shows how to get realtime quotes.

void Run()
{
    var api = new MT5API("EvolveMarkets-MT5 Demo Server", 7371, "mt5api");
    api.OnConnectStatus += ConnectionStatus;
    api.Connect();
    Console.WriteLine("Balance = " + api.Account().Balance);
    string symbol = "EURUSD";
    api.OnQuote += Api_OnQuote;
    api.Subscribe(symbol);
}
 
private void Api_OnQuote(MT5API api, Quote quote)
{
    Console.WriteLine(quote);
}
 
private void ConnectionStatus(MT5API sender, ConnectStatus e)
{
    Console.WriteLine(e);
}

Leave a Reply