private static void OptimizeTicksFiles() { var files = Directory.GetFiles(@"..\..\History\SBER-3.15", "*.txt"); foreach (var filename in files) { HistoryReader.OptimizeFile(filename); } }
private void FillByTicks(string toolName) { Days = new List <Day>(); var files = HistoryReader.GetTicksFiles(toolName); if (!files.Any()) { throw new Exception("Empty history"); } foreach (var filename in files) { var ticks = HistoryReader.ReadTicks(filename); var dayCandle = GetCandles(ticks, 60 * 24).Single(); var fiveMins = GetCandles(ticks, 5); Days.Add(new Day(dayCandle, fiveMins)); } Days = Days.OrderBy(day => day.Params.Date).Distinct().ToList(); }
private void ReadCandles(string toolName) { Days = HistoryReader.ReadCandles(toolName, 5); }