/// <summary> /// 实例化一个行情分发数据类 构造函数 /// </summary> /// <param name="accountName">账户名</param> /// <param name="userType">账户类型,0:用户,1:管理员,2:金商</param> /// <param name="mac">MAC地址</param> /// <param name="addr">行情源地址</param> /// <param name="port">行情源端口</param> public StockQuotationsDistribution(string accountName, int userType, string mac, string addr, int port) { _tcpCnt = new Tcpcnt(accountName, userType, mac, addr, port); _tcpCnt.RealCompleteEvent += (sender, e) => { string str = e.Obj.ToString(); string[] array = str.Split('\t', ' '); string stockCode = array[1]; string dataStr = str.Substring(array[0].Length + stockCode.Length + 2); CandleData data = CandleData.GetCandleDataFromString(dataStr); OnRealTimeDataUpdated(stockCode, data); }; }
/// <summary> /// 实例化一个行情分发数据类 构造函数 /// </summary> /// <param name="accountName">账户名</param> /// <param name="userType">账户类型,0:用户,1:管理员,2:金商</param> /// <param name="mac">MAC地址</param> /// <param name="addr">行情源地址</param> /// <param name="port">行情源端口</param> public StockQuotationsDistribution(string accountName, int userType, string mac, string addr, int port) { _tcpCnt = new Tcpcnt(accountName, userType, mac, addr, port); _tcpCnt.RealCompleteEvent += (sender, e) => { string str = e.Obj.ToString(); string[] array = str.Split('\t', ' '); string stockCode = array[1]; string dataStr = str.Substring(array[0].Length + stockCode.Length + 2); CandleData data = CandleData.GetCandleDataFromString(dataStr); OnRealTimeDataUpdated(stockCode, data); }; }