From f948a2d347faab8270b9336bdaafe16ae57526bd Mon Sep 17 00:00:00 2001 From: Mike van Rossum Date: Fri, 18 May 2018 18:45:31 +0200 Subject: [PATCH] define relativeYearlyProfit, fix #2190 --- plugins/performanceAnalyzer/performanceAnalyzer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/performanceAnalyzer/performanceAnalyzer.js b/plugins/performanceAnalyzer/performanceAnalyzer.js index 9dd2fb18b..00020cc49 100644 --- a/plugins/performanceAnalyzer/performanceAnalyzer.js +++ b/plugins/performanceAnalyzer/performanceAnalyzer.js @@ -161,6 +161,7 @@ PerformanceAnalyzer.prototype.calculateReportStatistics = function() { this.dates.end.diff(this.dates.start) ); const relativeProfit = this.balance / this.start.balance * 100 - 100; + const relativeYearlyProfit = relativeProfit / timespan.asYears(); const percentExposure = this.exposure / (Date.parse(this.dates.end) - Date.parse(this.dates.start)); @@ -182,7 +183,7 @@ PerformanceAnalyzer.prototype.calculateReportStatistics = function() { relativeProfit: relativeProfit, yearlyProfit: profit / timespan.asYears(), - relativeYearlyProfit: relativeProfit / timespan.asYears(), + relativeYearlyProfit, startPrice: this.startPrice, endPrice: this.endPrice,