예제 #1
0
        /*
         * private void ExecuteNotifyHandler(object sender, OrderArgs e)
         * {
         *
         *
         *  itemOrder iorder = e.ItemOrder;
         *
         *
         *
         *
         *  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 = iorder.msecsym;
         *  trade.side = iorder.IsBuyOrder();
         *  trade.xprice = Convert.ToDecimal(iorder.mprice);
         *  trade.xsize = iorder.mqty;
         *  DateTime mdate = ComFucs.GetDate(iorder.mm_date);
         *
         *  trade.xdate = mdate.Day+ mdate.Month*100+mdate.Year*10000;
         *  trade.xtime = mdate.Second + mdate.Minute*100+ mdate.Hour*10000 ;
         *  tl.newFill(trade);
         * }
         *
         *
         *
         * private void OrderHandler(object sender, OrderArgs e)
         * {
         *
         *
         *      itemOrder iorder = e.ItemOrder;
         *      // if (!ls.Contains(iorder.morigtkn)) return;
         *      DateTime mdate = ComFucs.GetDate(iorder.mm_date);
         *      Order o = new OrderImpl(iorder.msecsym, iorder.IsBuyOrder(), iorder.mqty, Convert.ToDecimal(iorder.mprice), Convert.ToDecimal(iorder.mstopprice), "",
         *                  mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000, mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000, iorder.morderid);
         *
         *      tl.newOrder(o);
         *
         *
         *
         * }
         *
         *
         * private void OrderModifyHandler(object sender, OrderArgs e)
         * {
         *
         *      if ((e.ItemOrder.mstatus | 0x0004) != 0)
         *      {
         *        //  tl.newCancel(e.ItemOrder.morderid);
         *      }
         *      if ((e.ItemOrder.mstatus | 0x0002) != 0)
         *      {
         *          itemOrder iorder = e.ItemOrder;
         *          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 = iorder.msecsym;
         *          trade.side = iorder.IsBuyOrder();
         *          trade.xprice = Convert.ToDecimal(iorder.mprice);
         *          trade.xsize = iorder.mqty;
         *          DateTime mdate = ComFucs.GetDate(iorder.mm_date);
         *          trade.xdate = mdate.Day + mdate.Month * 100 + mdate.Year * 10000;
         *          trade.xtime = mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000;
         *          tl.newFill(trade);
         *      }
         *
         *
         *
         * }
         * */


        private void Lv1Handler(object sender, Lv1Args e)
        {
            DateTime DT = new DateTime(1970, 1, 1);

            Tick t = new TickImpl();

            t.date   = Util.ToTLDate(DateTime.Now);
            t.time   = Util.DT2FT(DateTime.Now);
            t.symbol = e.TheIssuIfo.secsym;
            t.bid    = Convert.ToDecimal(e.TheIssuIfo.l1_BidPrice);
            t.ask    = Convert.ToDecimal(e.TheIssuIfo.l1_AskPrice);
            t.ex     = e.TheIssuIfo.PrimExch.ToString();
            t.trade  = Convert.ToDecimal(e.TheIssuIfo.l1_lastPrice);
            t.size   = e.TheIssuIfo.l1_volume;
            t.bs     = e.TheIssuIfo.l1_BidSize;
            t.os     = e.TheIssuIfo.l1_AskSize;
            t.ex     = e.TheIssuIfo.PrimExch.ToString();

            tl.newTick(t);
        }
예제 #2
0
        /*
        private void ExecuteNotifyHandler(object sender, OrderArgs e)
        {


            itemOrder iorder = e.ItemOrder;

           

            
            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 = iorder.msecsym;
            trade.side = iorder.IsBuyOrder();
            trade.xprice = Convert.ToDecimal(iorder.mprice);
            trade.xsize = iorder.mqty;
            DateTime mdate = ComFucs.GetDate(iorder.mm_date);

            trade.xdate = mdate.Day+ mdate.Month*100+mdate.Year*10000;
            trade.xtime = mdate.Second + mdate.Minute*100+ mdate.Hour*10000 ;
            tl.newFill(trade);
        }

       

        private void OrderHandler(object sender, OrderArgs e)
        {
            

                itemOrder iorder = e.ItemOrder;
                // if (!ls.Contains(iorder.morigtkn)) return;
                DateTime mdate = ComFucs.GetDate(iorder.mm_date);
                Order o = new OrderImpl(iorder.msecsym, iorder.IsBuyOrder(), iorder.mqty, Convert.ToDecimal(iorder.mprice), Convert.ToDecimal(iorder.mstopprice), "",
                            mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000, mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000, iorder.morderid);

                tl.newOrder(o);
            


        }


        private void OrderModifyHandler(object sender, OrderArgs e)
        {
            
                if ((e.ItemOrder.mstatus | 0x0004) != 0)
                {
                  //  tl.newCancel(e.ItemOrder.morderid);
                }
                if ((e.ItemOrder.mstatus | 0x0002) != 0)
                {
                    itemOrder iorder = e.ItemOrder;
                    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 = iorder.msecsym;
                    trade.side = iorder.IsBuyOrder();
                    trade.xprice = Convert.ToDecimal(iorder.mprice);
                    trade.xsize = iorder.mqty;
                    DateTime mdate = ComFucs.GetDate(iorder.mm_date);
                    trade.xdate = mdate.Day + mdate.Month * 100 + mdate.Year * 10000;
                    trade.xtime = mdate.Second + mdate.Minute * 100 + mdate.Hour * 10000;
                    tl.newFill(trade);
                }
            


        }
         * */


        private void Lv1Handler(object sender, Lv1Args e)
        {
           
            DateTime DT = new DateTime(1970, 1, 1);
            
            Tick t = new TickImpl();
            t.date = Util.ToTLDate(DateTime.Now);
            t.time = Util.DT2FT(DateTime.Now);
            t.symbol = e.TheIssuIfo.secsym;
            t.bid = Convert.ToDecimal(e.TheIssuIfo.l1_BidPrice);
            t.ask = Convert.ToDecimal(e.TheIssuIfo.l1_AskPrice);
            t.ex = e.TheIssuIfo.PrimExch.ToString();
            t.trade = Convert.ToDecimal(e.TheIssuIfo.l1_lastPrice);
            t.size = e.TheIssuIfo.l1_volume;
            t.bs = e.TheIssuIfo.l1_BidSize;
            t.os = e.TheIssuIfo.l1_AskSize;
            t.ex = e.TheIssuIfo.PrimExch.ToString();
           
            tl.newTick(t);

        }