|
@ -248,6 +248,7 @@ export class PortfolioCalculator { |
|
|
|
|
|
|
|
|
const accumulatedValuesByDate: { |
|
|
const accumulatedValuesByDate: { |
|
|
[date: string]: { |
|
|
[date: string]: { |
|
|
|
|
|
investmentValue: Big; |
|
|
totalCurrentValue: Big; |
|
|
totalCurrentValue: Big; |
|
|
totalCurrentValueWithCurrencyEffect: Big; |
|
|
totalCurrentValueWithCurrencyEffect: Big; |
|
|
totalInvestmentValue: Big; |
|
|
totalInvestmentValue: Big; |
|
@ -341,6 +342,7 @@ export class PortfolioCalculator { |
|
|
] ?? new Big(0); |
|
|
] ?? new Big(0); |
|
|
|
|
|
|
|
|
accumulatedValuesByDate[dateString] = { |
|
|
accumulatedValuesByDate[dateString] = { |
|
|
|
|
|
investmentValue, |
|
|
totalCurrentValue: ( |
|
|
totalCurrentValue: ( |
|
|
accumulatedValuesByDate[dateString]?.totalCurrentValue ?? new Big(0) |
|
|
accumulatedValuesByDate[dateString]?.totalCurrentValue ?? new Big(0) |
|
|
).add(currentValue), |
|
|
).add(currentValue), |
|
@ -378,6 +380,7 @@ export class PortfolioCalculator { |
|
|
|
|
|
|
|
|
return Object.entries(accumulatedValuesByDate).map(([date, values]) => { |
|
|
return Object.entries(accumulatedValuesByDate).map(([date, values]) => { |
|
|
const { |
|
|
const { |
|
|
|
|
|
investmentValue, |
|
|
totalCurrentValue, |
|
|
totalCurrentValue, |
|
|
totalCurrentValueWithCurrencyEffect, |
|
|
totalCurrentValueWithCurrencyEffect, |
|
|
totalInvestmentValue, |
|
|
totalInvestmentValue, |
|
@ -407,6 +410,7 @@ export class PortfolioCalculator { |
|
|
date, |
|
|
date, |
|
|
netPerformanceInPercentage, |
|
|
netPerformanceInPercentage, |
|
|
netPerformanceInPercentageWithCurrencyEffect, |
|
|
netPerformanceInPercentageWithCurrencyEffect, |
|
|
|
|
|
investment: investmentValue.toNumber(), |
|
|
netPerformance: totalNetPerformanceValue.toNumber(), |
|
|
netPerformance: totalNetPerformanceValue.toNumber(), |
|
|
netPerformanceWithCurrencyEffect: |
|
|
netPerformanceWithCurrencyEffect: |
|
|
totalNetPerformanceValueWithCurrencyEffect.toNumber(), |
|
|
totalNetPerformanceValueWithCurrencyEffect.toNumber(), |
|
|