Example #1
0
        private async Task <bool> HasMarketAsync(MarketItem marketItem, int regionId, int daysToEvaluate, int minAverageVolumePerDay, int minOrdersPerDay)
        {
            try
            {
                var orders = (await _marketApi.GetMarketsRegionIdHistoryAsync(regionId, marketItem.Id)).OrderByDescending(x => x.Date)
                             .Take(daysToEvaluate).ToList();

                return(AreConsecutiveDays(orders, daysToEvaluate) &&
                       GetAverageDailyRevenue(orders) >= minAverageVolumePerDay &&
                       HasMinNumberOfOrders(orders, minOrdersPerDay));
            }
            catch
            {
                return(false);
            }
        }