Beispiel #1
0
        /// <summary>
        /// 港股行情调度事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void HKStockRealtimeMarketChangeEvent(object sender, HKStockDataChangeEventArg e)
        {
            if (e == null || e.HqData == null || e.HqData == null)
            {
                return;
            }

            if (!MatchCodeDictionary.hk_ActivityOrderDic.ContainsKey(e.HqData.CodeKey))
            {
                return;
            }

            //不显示行情信息就不再处理
            if (isShowRealTimeMsg)
            {
                string nowTime = DateTime.Now.ToString();
                var    data    = e.HqData;
                string msg     = data.CodeKey + "行情到达:{0}  行情时间:{1} 成交价:{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, e.HqData.PTrans, 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, ListHKHQWork); }, wrmsg);
            }

            smartPool.QueueWorkItem(FindHKStockMatchCode, e);
        }
Beispiel #2
0
        /// <summary>
        /// 港股行情调度查询撮合代码撮合事件
        /// </summary>
        /// <param name="hqData">撮合行情</param>
        public static void FindHKStockMatchCode(HKStockDataChangeEventArg hqData)
        {
            string code = hqData.HqData.CodeKey;

            if (MatchCodeDictionary.hkStockMatchCodeDic.ContainsKey(code))
            {
                EventHandler <HKStockDataChangeEventArg> eventArg = MatchCodeDictionary.hkStockMatchCodeDic[code];
                if (eventArg != null)
                {
                    eventArg(null, hqData);
                }
            }
        }