Exemple #1
0
        public PbTickView Int2Double(PbTick tick, bool descending)
        {
            if (tick == null)
            {
                return(null);
            }

            var view = new PbTickView();

            // 利用此机会设置TickSize
            if (Codec == null)
            {
                Codec = new PbTickCodec();
            }
            view.Config         = Int2Double(tick.Config);
            Codec.Config        = tick.Config;
            view.Turnover       = Codec.GetTurnover(tick);
            view.AveragePrice   = Codec.GetAveragePrice(tick);
            view.LastPrice      = Codec.TickToPrice(tick.LastPrice);
            view.AskPrice1      = Codec.TickToPrice(tick.AskPrice1);
            view.Volume         = tick.Volume;
            view.OpenInterest   = tick.OpenInterest;
            view.TradingDay     = tick.TradingDay;
            view.ActionDay      = tick.ActionDay;
            view.Time_HHmm      = tick.Time_HHmm;
            view.Time_____ssf__ = tick.Time_____ssf__;
            view.Time________ff = tick.Time________ff;
            view.Bar            = Int2Double(tick.Bar);
            view.Static         = Int2Double(tick.Static);
            view.Split          = Int2Double(tick.Split);
            view.LocalTime_Msec = tick.LocalTime_Msec;
            view.DepthList      = Int2Double(tick.DepthList, descending);
            view.LoadQuote(descending);
            return(view);
        }