示例#1
0
        private void TradeHandler(object sender, TradeArgs e)
        {
            itemTrade itrade = e.ItemTrade;



            // Order o = new OrderImpl(iorder.msecsym, iorder.IsBuyOrder(), iorder.mqty, Convert.ToDecimal(iorder.mprice), Convert.ToDecimal(iorder.mstopprice), "", iorder.mc_date, iorder.mc_date, iorder.morderid);
            Trade trade = new TradeImpl();

            trade.symbol = itrade.msecsym;
            itemOrder lorder = socketOrderServer.sitemOrder.FindItem(itrade.morderid);

            if (lorder == null)
            {
                return;
            }
            trade.side   = lorder.IsBuyOrder();
            trade.xprice = Convert.ToDecimal(itrade.mprice);
            trade.xsize  = itrade.mqty;
            DateTime mdate = ComFucs.GetDate(itrade.mm_date);

            trade.Account = "";
            trade.xdate   = mdate.Day + mdate.Month * 100 + mdate.Year * 10000;
            trade.xtime   = mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000;
            tl.newFill(trade);
        }
示例#2
0
 void m_Session_OnExecutionMessage(object sender, BWExecution executionMsg)
 {
     foreach (KeyValuePair <long, int> ordID in _bwOrdIds)
     {
         if (ordID.Value == executionMsg.OrderID)
         {
             Trade t = new TradeImpl(executionMsg.Symbol, (decimal)executionMsg.Price, executionMsg.Size);
             t.side    = (executionMsg.Side == ORDER_SIDE.SIDE_COVER) || (executionMsg.Side == ORDER_SIDE.SIDE_BUY);
             t.xtime   = TradeLink.Common.Util.DT2FT(executionMsg.ExecutionTime);
             t.xdate   = TradeLink.Common.Util.ToTLDate(executionMsg.ExecutionTime);
             t.Account = executionMsg.UserID.ToString();
             t.id      = ordID.Key;
             t.ex      = executionMsg.MarketMaker;
             tl.newFill(t);
         }
     }
 }
示例#3
0
 void SimBroker_GotFill(Trade t)
 {
     tl.newFill(t);
 }