Ejemplo n.º 1
0
        private void TakeTickersSnapshot()
        {
            var tickers = tradingService.GetTickers().Select(t => TickerData.FromTicker(t));

            byte[] tickerBytes             = ZeroFormatterSerializer.Serialize(tickers);
            string tickersSnapshotFilePath = backtestingService.GetSnapshotFilePath(Constants.SnapshotEntities.Tickers);
            var    tickersSnapshotFile     = new FileInfo(tickersSnapshotFilePath);

            tickersSnapshotFile.Directory.Create();
            File.WriteAllBytes(tickersSnapshotFilePath, tickerBytes);

            healthCheckService.UpdateHealthCheck(Constants.HealthChecks.BacktestingTickersSnapshotTaken, $"Tickers: {tickers.Count()}");
        }