/// <summary> /// 期货行情调度事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public static void FutRealtimeMarketChangeEvent(object sender, FutDataChangeEventArg e) { if (e == null || e.HqData == null) { return; } if (!MatchCodeDictionary.qh_ActivityOrderDic.ContainsKey(e.HqData.CodeKey)) { return; } //不显示行情信息就不再处理 if (isShowRealTimeMsg) { string nowTime = DateTime.Now.ToString(); var data = e.HqData; string msg = data.CodeKey + "行情到达:{0} 行情时间:{1}\r\n成交价:{2}--{3}\r\n"; msg += "卖一:{4}--{5} 卖五:{6}--{7} "; msg += "买一:{8}--{9} 买五:{10}--{11}\r\n "; string wrmsg = string.Format(msg, nowTime, data.Time, data.Lasttrade, data.LastVolume, data.Sellprice1, data.Sellvol1, data.Sellprice5, data.Sellvol5 , data.Buyprice1, data.Buyvol1, data.Buyprice5, data.Buyvol5); smartPool.QueueWorkItem(delegate(object state) { MessageDisplayHelper.Event((string)state, ListQHHQWork); }, wrmsg); } //LogHelper.WriteDebug(wrmsg); // MessageDisplayHelper.Event(wrmsg, ListQHHQWork); smartPool.QueueWorkItem(FindFuntureMatchCode, e); }
/// <summary> /// 期货行情调度查询撮合代码撮合事件 /// </summary> /// <param name="hqData">期货行情实体</param> public static void FindFuntureMatchCode(FutDataChangeEventArg hqData) { string code = hqData.HqData.CodeKey; if (MatchCodeDictionary.funtureMatchCodeDic.ContainsKey(code)) { EventHandler <FutDataChangeEventArg> eventArg = MatchCodeDictionary.funtureMatchCodeDic[code]; if (eventArg != null) { eventArg(null, hqData); } } }