marketTrendChanges.Count fix

This commit is contained in:
HojouFotytu 2021-01-31 22:33:42 +09:00
parent c2bbc274b5
commit 65bb1dc719
1 changed files with 4 additions and 2 deletions

View File

@ -431,6 +431,7 @@ namespace Core.MarketAnalyzer
double totalTrendChange = 0; double totalTrendChange = 0;
int trendChangeCount = marketTrendChanges.Count;
foreach (MarketTrendChange marketTrendChange in marketTrendChanges) foreach (MarketTrendChange marketTrendChange in marketTrendChanges)
{ {
@ -438,7 +439,8 @@ namespace Core.MarketAnalyzer
{ {
if ((marketTrendChange.TrendChange > marketTrend.IgnoreOutlier) || (marketTrendChange.TrendChange < (marketTrend.IgnoreOutlier * -1))) 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 else
{ {
@ -451,7 +453,7 @@ namespace Core.MarketAnalyzer
} }
} }
double averageTrendChange = totalTrendChange / marketTrendChanges.Count; double averageTrendChange = totalTrendChange / trendChangeCount;
result.Add(marketTrend.Name, averageTrendChange); result.Add(marketTrend.Name, averageTrendChange);