Exemplo n.º 1
0
        private string[] GetRemoteInstruments(string[] instruments)
        {
            IPlugin_MarketUtils marketUtils = plugin_MarketUtils;

            if (marketUtils == null)
            {
                return(instruments);
            }
            string[] remoteInstruments = new string[instruments.Length];
            for (int i = 0; i < instruments.Length; i++)
            {
                remoteInstruments[i] = marketUtils.TransferLocalInstrumentIdToRemote(instruments[i]);
            }
            return(remoteInstruments);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 连接指定服务器
        /// </summary>
        public void Connect(ConnectionInfo connectionInfo)
        {
            LogHelper.Info(GetType(), "开始连接数据服务器:" + connectionInfo.Name);
            IPlugin_Market plugin_Market = marketPluginMgr.GetMarketDataByConnection(connectionInfo);

            if (plugin_Market == null)
            {
                throw new ApplicationException("连接" + connectionInfo.Name + "找不到对应插件");
            }

            this.plugin_MarketUtils       = plugin_Market.MarketUtils;
            this.currentPlugin_MarketData = plugin_Market.MarketData;
            if (currentPlugin_MarketData == null)
            {
                throw new ApplicationException("连接" + connectionInfo.Name + "未实现市场数据插件");
            }

            this.currentConnectionInfo = connectionInfo;
            this.currentPlugin_MarketData.OnConnectionStatus = OnConnectionStatus;
            this.currentPlugin_MarketData.OnReturnMarketData = OnReturnMarketData;
            this.currentPlugin_MarketData.Connect(connectionInfo);
        }