Exemple #1
0
        //connect to server and start monitoring new deals
        public void StartWatch()
        {
            using (clsMT5 mt5 = new clsMT5())
            {
                mt5.Initialize();

                var log_result = mt5.m_manager.Connect(this.Connection.Server, this.Connection.uLogin, this.Connection.Password, "", MetaQuotes.MT5ManagerAPI.CIMTManagerAPI.EnPumpModes.PUMP_MODE_FULL, 10000);
                if (log_result != MTRetCode.MT_RET_OK)
                {
                    return;
                }

                clsDealSink myDealSink = new clsDealSink();
                myDealSink.set_report_function(this.TellOutside);
                mt5.SubscribeDealSink(ref myDealSink);
                while (this.RunMe)
                {
                    Thread.Sleep(1000);
                }

                Console.WriteLine("Quting watching");
            }
        }