示例#1
0
        public Bars BarsRead()
        {
            Bars     ret   = null;
            DateTime start = DateTime.Now;
            Storage  db    = StorageFactory.Instance.CreateStorage();

            db.Open(this.Abspath, pagePoolSize);
            BarsPerst barsPerst = db.Root as BarsPerst;

            if (barsPerst == null)
            {
                return(ret);
            }
            ret = new Bars(barsPerst.Symbol, barsPerst.ScaleInterval, this.Abspath);
            foreach (BarPerst barPerst in barsPerst.BarsStored)
            {
                ret.BarCreateAppend(new DateTime(barPerst.Time), barPerst.Open, barPerst.High, barPerst.Low, barPerst.Close, barPerst.Volume);
            }
            db.Close();
            string msg = "Elapsed time for reading " + ret.Count + " bars: " + (DateTime.Now - start);

            return(ret);
        }