|
@ -19,12 +19,12 @@ import { |
|
|
resetHours |
|
|
resetHours |
|
|
} from '@ghostfolio/common/helper'; |
|
|
} from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { |
|
|
|
|
|
AssetProfileIdentifier, |
|
|
DataProviderInfo, |
|
|
DataProviderInfo, |
|
|
HistoricalDataItem, |
|
|
HistoricalDataItem, |
|
|
InvestmentItem, |
|
|
InvestmentItem, |
|
|
ResponseError, |
|
|
ResponseError, |
|
|
SymbolMetrics, |
|
|
SymbolMetrics |
|
|
UniqueAsset |
|
|
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
import { PortfolioSnapshot, TimelinePosition } from '@ghostfolio/common/models'; |
|
|
import { PortfolioSnapshot, TimelinePosition } from '@ghostfolio/common/models'; |
|
|
import { DateRange, GroupBy } from '@ghostfolio/common/types'; |
|
|
import { DateRange, GroupBy } from '@ghostfolio/common/types'; |
|
@ -356,15 +356,15 @@ export abstract class PortfolioCalculator { |
|
|
dataSource: item.dataSource, |
|
|
dataSource: item.dataSource, |
|
|
fee: item.fee, |
|
|
fee: item.fee, |
|
|
firstBuyDate: item.firstBuyDate, |
|
|
firstBuyDate: item.firstBuyDate, |
|
|
grossPerformance: !hasErrors ? grossPerformance ?? null : null, |
|
|
grossPerformance: !hasErrors ? (grossPerformance ?? null) : null, |
|
|
grossPerformancePercentage: !hasErrors |
|
|
grossPerformancePercentage: !hasErrors |
|
|
? grossPerformancePercentage ?? null |
|
|
? (grossPerformancePercentage ?? null) |
|
|
: null, |
|
|
: null, |
|
|
grossPerformancePercentageWithCurrencyEffect: !hasErrors |
|
|
grossPerformancePercentageWithCurrencyEffect: !hasErrors |
|
|
? grossPerformancePercentageWithCurrencyEffect ?? null |
|
|
? (grossPerformancePercentageWithCurrencyEffect ?? null) |
|
|
: null, |
|
|
: null, |
|
|
grossPerformanceWithCurrencyEffect: !hasErrors |
|
|
grossPerformanceWithCurrencyEffect: !hasErrors |
|
|
? grossPerformanceWithCurrencyEffect ?? null |
|
|
? (grossPerformanceWithCurrencyEffect ?? null) |
|
|
: null, |
|
|
: null, |
|
|
investment: totalInvestment, |
|
|
investment: totalInvestment, |
|
|
investmentWithCurrencyEffect: totalInvestmentWithCurrencyEffect, |
|
|
investmentWithCurrencyEffect: totalInvestmentWithCurrencyEffect, |
|
@ -372,15 +372,15 @@ export abstract class PortfolioCalculator { |
|
|
marketSymbolMap[endDateString]?.[item.symbol]?.toNumber() ?? null, |
|
|
marketSymbolMap[endDateString]?.[item.symbol]?.toNumber() ?? null, |
|
|
marketPriceInBaseCurrency: |
|
|
marketPriceInBaseCurrency: |
|
|
marketPriceInBaseCurrency?.toNumber() ?? null, |
|
|
marketPriceInBaseCurrency?.toNumber() ?? null, |
|
|
netPerformance: !hasErrors ? netPerformance ?? null : null, |
|
|
netPerformance: !hasErrors ? (netPerformance ?? null) : null, |
|
|
netPerformancePercentage: !hasErrors |
|
|
netPerformancePercentage: !hasErrors |
|
|
? netPerformancePercentage ?? null |
|
|
? (netPerformancePercentage ?? null) |
|
|
: null, |
|
|
: null, |
|
|
netPerformancePercentageWithCurrencyEffect: !hasErrors |
|
|
netPerformancePercentageWithCurrencyEffect: !hasErrors |
|
|
? netPerformancePercentageWithCurrencyEffect ?? null |
|
|
? (netPerformancePercentageWithCurrencyEffect ?? null) |
|
|
: null, |
|
|
: null, |
|
|
netPerformanceWithCurrencyEffect: !hasErrors |
|
|
netPerformanceWithCurrencyEffect: !hasErrors |
|
|
? netPerformanceWithCurrencyEffect ?? null |
|
|
? (netPerformanceWithCurrencyEffect ?? null) |
|
|
: null, |
|
|
: null, |
|
|
quantity: item.quantity, |
|
|
quantity: item.quantity, |
|
|
symbol: item.symbol, |
|
|
symbol: item.symbol, |
|
@ -905,7 +905,7 @@ export abstract class PortfolioCalculator { |
|
|
}; |
|
|
}; |
|
|
start: Date; |
|
|
start: Date; |
|
|
step?: number; |
|
|
step?: number; |
|
|
} & UniqueAsset): SymbolMetrics; |
|
|
} & AssetProfileIdentifier): SymbolMetrics; |
|
|
|
|
|
|
|
|
public getTransactionPoints() { |
|
|
public getTransactionPoints() { |
|
|
return this.transactionPoints; |
|
|
return this.transactionPoints; |
|
|