Example #1
0
        public async Task Get(StrategyRequest request)
        {
            await _stocksRepository.DeleteIncomeStatementEntities();

            await _stocksRepository.DeleteStockProfileEntities();

            await _stocksRepository.DeleteBalanceSheetEntities();

            var sortedStocks = await _stockListService.GetSortedStocks(new DCFRequest()
            {
                DividendMoreThan  = request.Dividend,
                MarketCapMoreThan = request.MarketCapMoreThan,
                Sector            = request.Sector,
                VolumeMoreThan    = request.VolumeMoreThan
            });

            foreach (var item in sortedStocks)
            {
                await _balanceSheetProvider.GetBalanceSheets(item.Symbol);
            }

            var stockSplits = ListExtensions.Split(sortedStocks, 5);

            foreach (var stockSplit in stockSplits)
            {
                var stockSymbols  = StringExtensions.GetSymbolsString(stockSplit.Select(x => x.Symbol).ToArray());
                var stockProfiles = await _profileProvider.GetStockProfile(stockSymbols);
            }

            foreach (var stock in sortedStocks)
            {
                await _incomeStatementProvider.GetIncomeStatements(stock.Symbol);
            }
        }