コード例 #1
0
        public async Task InsertStockBars(List <IAgg> bars, int symbolId)
        {
            var listCandles = new List <StockDashboard.Models.Candle>();

            foreach (var bar in bars)
            {
                var candle = new StockDashboard.Models.Candle()
                {
                    AdjustedClose = 0,
                    Close         = bar.Close,
                    High          = bar.High,
                    Low           = bar.Low,
                    Open          = bar.Open,
                    DateTime      = bar.Time.Date,
                    Volume        = bar.Volume
                };
                listCandles.Add(candle);
            }
            await BR.BulkBarInsert(listCandles, symbolId);
        }