Exemplo n.º 1
0
 /// <summary>
 /// 港股成交回报处理
 /// </summary>
 /// <param name="drsip">港股回推的委托数据</param>
 public void ProcessHKDealRpt(HKDealOrderPushBack drsip)
 {
     //Program.mainForm.ProcessHKBack(drsip);
     if (HKView != null)
     {
         smartPool.QueueWorkItem(HKView.ProcessPushBack, drsip);
     }
 }
        public void ProcessPushBack(HKDealOrderPushBack drsip)
        {
            var tet   = drsip.HKOrderEntity;
            var deals = drsip.HKDealList;

            string entrustNumber = tet.EntrustNumber;

            //因为Type3的改单的改单回报有可能比这个pushback要迟,所以稍微延迟一下
            //进行多次查找
            bool canFind = false;

            for (int i = 0; i < 3; i++)
            {
                if (hkMessageCache.Contains(entrustNumber))
                {
                    canFind = true;
                    break;
                }

                Thread.Sleep(1000);
            }

            if (!canFind)
            {
                if (!hkMessageCache.Contains(entrustNumber))
                {
                    LogHelper.WriteDebug("委托" + entrustNumber + "不存在缓存中");
                    return;
                }
            }

            var message = hkMessageCache.Get(entrustNumber);

            message.EntrustAmount = tet.EntrustAmount.ToString();
            message.TradeAmount   = tet.TradeAmount.ToString();
            message.CancelAmount  = tet.CancelAmount.ToString();
            message.OrderMessage  = tet.OrderMessage;
            message.OrderStatus   = Utils.GetOrderStateMsg(tet.OrderStatusId);

            if (deals.Count > 0)
            {
                message.TradeTime = deals[deals.Count - 1].TradeTime.ToString();
            }

            HasChanged = true;
        }
Exemplo n.º 3
0
 public void ProcessHKDealRpt(HKDealOrderPushBack drsip)
 {
     Program.MainForm.ProcessHKBack(drsip);
 }