Beispiel #1
0
        private void InternalStop()
        {
            if (m_fundCalculator != null)
            {
                try
                {
                    m_fundCalculator.Stop();
                }
                catch (Exception ex)
                {
                    string text = String.Format("{0} Close fundCalculator failed, Error: {1}", this, ex.Message);
                    m_eventLogger.WriteWarning(text);
                }
            }

            if (m_orderDriver != null)
            {
                try
                {
                    m_orderDriver.Logout();
                    m_orderDriver.DisConnectServer();
                    // 1.登出
                    // 2.关闭
                    string text = String.Format("{0} Close OrderDriver OK.", this);
                    m_eventLogger.WriteInformation(text);
                }
                catch (Exception ex)
                {
                    string text = String.Format("{0} Close OrderDriver failed, Error: {1}", this, ex.Message);
                    m_eventLogger.WriteWarning(text);
                }
            }

            if (m_quoteDriver != null)
            {
                try
                {
                    // 1.登出
                    m_quoteDriver.Logout();
                    // 2.关闭
                    m_quoteDriver.DisConnectServer();
                    string text = String.Format("{0} Close QuoteDriver OK.", this);
                    m_eventLogger.WriteInformation(text);
                }
                catch (Exception ex)
                {
                    string text = String.Format("{0} Close QuoteDriver failed, Error: {1}", this, ex.Message);
                    m_eventLogger.WriteWarning(text);
                }
            }

            if (m_dataSaver != null)
            {
                try
                {
                    m_dataSaver.Stop();
                }
                catch (Exception ex)
                {
                    string text = String.Format("{0} Close ArbitrageDataSaver failed, Error: {1}", this, ex.Message);
                    m_eventLogger.WriteWarning(text);
                }
            }
        }