예제 #1
0
        private List <StockQuote> Transfer(StockBlock stockData)
        {
            List <StockQuote> results = new List <StockQuote>();

            foreach (Quotation.Stock s in stockData.Stock)
            {
                StockQuote stock = Transfer(s);
                results.Add(stock);
            }
            return(results);
        }
예제 #2
0
        private StockQuote Transfer(Quotation.Stock s)
        {
            StockQuote result = new StockQuote()
            {
                SecurityId = ParseSecurityId(s.SzCode, s.SzWindCode),
                TradingDay = s.NTradingDay,
                Time       = s.NTime,
                Status     = s.NStatus,
                PreClose   = PriceTransfer(s.NPreClose),
                Open       = PriceTransfer(s.NOpen),
                High       = PriceTransfer(s.NHigh),
                Low        = PriceTransfer(s.NLow),
                Match      = PriceTransfer(s.NMatch),
                AskPrice   = new decimal[]
                {
                    PriceTransfer(s.NAskPrice0),
                    PriceTransfer(s.NAskPrice1),
                    PriceTransfer(s.NAskPrice2),
                    PriceTransfer(s.NAskPrice3),
                    PriceTransfer(s.NAskPrice4),
                    PriceTransfer(s.NAskPrice5),
                    PriceTransfer(s.NAskPrice6),
                    PriceTransfer(s.NAskPrice7),
                    PriceTransfer(s.NAskPrice8),
                    PriceTransfer(s.NAskPrice9),
                },
                AskVol = new decimal[]
                {
                    VolTransfer(s.NAskVol0),
                    VolTransfer(s.NAskVol1),
                    VolTransfer(s.NAskVol2),
                    VolTransfer(s.NAskVol3),
                    VolTransfer(s.NAskVol4),
                    VolTransfer(s.NAskVol5),
                    VolTransfer(s.NAskVol6),
                    VolTransfer(s.NAskVol7),
                    VolTransfer(s.NAskVol8),
                    VolTransfer(s.NAskVol9),
                },
                BidPrice = new decimal[]
                {
                    PriceTransfer(s.NBidPrice0),
                    PriceTransfer(s.NBidPrice1),
                    PriceTransfer(s.NBidPrice2),
                    PriceTransfer(s.NBidPrice3),
                    PriceTransfer(s.NBidPrice4),
                    PriceTransfer(s.NBidPrice5),
                    PriceTransfer(s.NBidPrice6),
                    PriceTransfer(s.NBidPrice7),
                    PriceTransfer(s.NBidPrice8),
                    PriceTransfer(s.NBidPrice9),
                },
                BidVol = new decimal[]
                {
                    VolTransfer(s.NBidVol0),
                    VolTransfer(s.NBidVol1),
                    VolTransfer(s.NBidVol2),
                    VolTransfer(s.NBidVol3),
                    VolTransfer(s.NBidVol4),
                    VolTransfer(s.NBidVol5),
                    VolTransfer(s.NBidVol6),
                    VolTransfer(s.NBidVol7),
                    VolTransfer(s.NBidVol8),
                    VolTransfer(s.NBidVol9),
                },
                NumTrades           = s.NNumTrades,
                Volume              = VolTransfer(s.IVolume),
                Turnover            = VolTransfer(s.ITurnover),
                TotalBidVol         = VolTransfer(s.NTotalBidVol),
                TotalAskVol         = VolTransfer(s.NTotalAskVol),
                WeightedAvgBidPrice = PriceTransfer(s.NWeightedAvgBidPrice),
                WeightedAvgAskPrice = PriceTransfer(s.NWeightedAvgAskPrice),
                IOPV            = PriceTransfer(s.NIOPV),
                YieldToMaturity = PriceTransfer(s.NYieldToMaturity),
                HighLimited     = PriceTransfer(s.NHighLimited),
                LowLimited      = PriceTransfer(s.NLowLimited),
            };

            return(result);
        }