public DateTimeSlice GetLivingDateTime(DateTime tradingday, string instrumentid)
        {
            TimeSlice tslice = GetLivingTime(tradingday, instrumentid);

            return(new DateTimeSlice()
            {
                BeginTime = YfTimeHelper.GetDateTimeByTradingDay(tradingday, tslice.BeginTime),
                EndTime = YfTimeHelper.GetDateTimeByTradingDay(tradingday, tslice.EndTime)
            });
        }
Ejemplo n.º 2
0
        static List <DateTimeSlice> CreateDateTimeSlice(DateTime tradingday, List <TimeSlice> lsttimeslice)
        {
            DateTime pretradingday1 = TradingDayHelper.GetPreTradingDay(tradingday);
            DateTime pretradingday2 = pretradingday1.AddDays(1).Date;

            List <DateTimeSlice> lstslice = new List <DateTimeSlice>(lsttimeslice.Count);

            foreach (TimeSlice timeslice in lsttimeslice)
            {
                lstslice.Add(new DateTimeSlice()
                {
                    BeginTime = YfTimeHelper.JoinDateTime(tradingday, pretradingday1, pretradingday2, timeslice.BeginTime),
                    EndTime   = YfTimeHelper.JoinDateTime(tradingday, pretradingday1, pretradingday2, timeslice.EndTime)
                });
            }

            return(lstslice);
        }