// here is cache filling for single core public void SingleCoreFillCache(int readahead) { readcount = 0; while (!CancellationPending && workersec.hasHistorical && (readcount++ < readahead)) { Ticks.Enqueue(workersec.NextTick()); } }
// fill cache for multi-core void simworker_DoWork(object sender, DoWorkEventArgs e) { isWorking = true; int readahead = (int)e.Argument; // while simulation hasn't been canceled, we still have historical ticks to read and we haven't read too many, cache a tick while ((!e.Cancel && workersec.NextTick() && (readcount++ < readahead))) { ; } }
/// <summary> /// converts EPF files to tradelink tick files in current directory /// </summary> /// <param name="args"></param> public static void EPF2TIK(string[] args) { // get a list of epf files foreach (string file in args) { SecurityImpl sec = SecurityImpl.FromTIK(file); sec.HistSource.gotTick += new TradeLink.API.TickDelegate(HistSource_gotTick); _tw = new TikWriter(sec.Symbol); while (sec.NextTick()) { _tw.Close(); } } }