Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
define relativeYearlyProfit, fix #2190
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed May 18, 2018
1 parent c6faee1 commit f948a2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/performanceAnalyzer/performanceAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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,
Expand Down

0 comments on commit f948a2d

Please sign in to comment.