コード例 #1
0
        public override void SaveTicks(List <Ticks> ticks, ConfigSettings settings, string tableName)
        {
            SQLiteBulkInsert sbi = DataAccessFactory.GetBulkDatabase(settings, tableName);

            sbi.ClearTable(tableName);

            sbi.AddParameter("symbol", DbType.String);
            sbi.AddParameter("time", DbType.DateTime);
            sbi.AddParameter("open", DbType.Decimal);
            sbi.AddParameter("high", DbType.Decimal);
            sbi.AddParameter("low", DbType.Decimal);
            sbi.AddParameter("close", DbType.Decimal);
            sbi.AddParameter("volume", DbType.Int32);
            foreach (Ticks tt in ticks)
            {
                foreach (var t in tt.TickGroup)
                {
                    sbi.Insert(new object[] { tt.Symbol, t.Date, t.Open, t.High, t.Low, t.Close, t.Volume });
                }
            }
            sbi.Flush();
        }