From 65bb1dc719c6472c0a0033f0b0b2d32d494d3a95 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sun, 31 Jan 2021 22:33:42 +0900 Subject: [PATCH] marketTrendChanges.Count fix --- Core/MarketAnalyzer/BaseAnalyzer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/MarketAnalyzer/BaseAnalyzer.cs b/Core/MarketAnalyzer/BaseAnalyzer.cs index 9ef9931..42d4edb 100644 --- a/Core/MarketAnalyzer/BaseAnalyzer.cs +++ b/Core/MarketAnalyzer/BaseAnalyzer.cs @@ -431,6 +431,7 @@ namespace Core.MarketAnalyzer double totalTrendChange = 0; + int trendChangeCount = marketTrendChanges.Count; foreach (MarketTrendChange marketTrendChange in marketTrendChanges) { @@ -438,7 +439,8 @@ namespace Core.MarketAnalyzer { if ((marketTrendChange.TrendChange > marketTrend.IgnoreOutlier) || (marketTrendChange.TrendChange < (marketTrend.IgnoreOutlier * -1))) { - log.DoLogWarn("Market trend '" + marketTrend.Name + "' is ignoring the outlier '" + marketTrendChange.Market + "."); + log.DoLogWarn("Market trend '" + marketTrend.Name + "' is ignoring " + marketTrendChange.Market + " for exceeding TrendThreshold."); + trendChangeCount += -1; } else { @@ -451,7 +453,7 @@ namespace Core.MarketAnalyzer } } - double averageTrendChange = totalTrendChange / marketTrendChanges.Count; + double averageTrendChange = totalTrendChange / trendChangeCount; result.Add(marketTrend.Name, averageTrendChange);