MT5 Monitoring trading

easy direct connection to any MT4 and MT5 server

MT5 Monitoring trading

Code below shows how to monitor account trading activity.

static void monitoring()
{
    var api = new MT5API("45.76.194.231:443", 7371, "mt5api");
    api.OnConnectStatus += ConnectionStatus;
    api.Connect();
    api.OnOrderUpdate += Api_OnOrderUpdate;
    Console.WriteLine("Try to opne/close orders on this account in MT5 Terminal to see output here");
    Console.ReadKey();
}
 
private static void Api_OnOrderUpdate(MT5API api, OrderUpdate update, Order order)
{
    Console.WriteLine(order.Ticket + " " + update);
}
 
private static void ConnectionStatus(MT5API api, ConnectStatus status)
{
    Console.WriteLine(status);
}

Leave a Reply