public static void InitSpot(KlineDataPool kdp) { using (OptionDbCtx db = new OptionDbCtx()) { var l = db.Ohlcs.Where(a => a.WhatId < 0).OrderByDescending(a => a.Id).Take(1000); foreach (var v in l) { kdp.Add(v); } } }
public static void InitOption(KlineDataPool kdp, List <int> cids) { using (OptionDbCtx db = new OptionDbCtx()) { var l = db.Ohlcs.Where(a => a.WhatId > 0 && cids.Contains(a.WhatId)).OrderByDescending(a => a.Id).Take(1000).ToList(); l.Reverse(); foreach (var v in l) { kdp.Add(v); } } }
void OhlcMaker_OnOhlcMaked(Ohlc obj) { kdp.Add(obj); ohlcSaver.Save(obj); }