MT5 realtime quotes

easy direct connection to any MT4 and MT5 server

MT5 realtime quotes

using mtapi.mt5;
using mtapi.mt5.wrapper;
using System;
 
namespace TestSubscribe
{
    class Program
    {
        static void Main(string[] args)
        {
            var api = new MT5Client("209.222.26.5:443", 7371, "mt5api");
            api.OnConnectionStatus += ConnectionStatus;
            api.Connect();
            api.OnQuote += OnQuote;
            api.Subscribe("EURUSD");
            Console.WriteLine("Press any key...");
            Console.ReadKey();
        }
 
        private static void OnQuote(object sender, SubscribedSymbol e)
        {
            Console.WriteLine(e.Bid + " " + e.Ask);
        }
 
        private static void ConnectionStatus(object sender, ServerStatus e)
        {
            Console.WriteLine(e);
        }
    }
}

Leave a Reply