|
@ -456,12 +456,19 @@ export class RoaiPortfolioCalculator extends PortfolioCalculator { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const marketPriceInBaseCurrency = |
|
|
|
|
|
order.unitPriceFromMarketData?.mul(currentExchangeRate ?? 1) ?? |
|
|
|
|
|
new Big(0); |
|
|
|
|
|
const marketPriceInBaseCurrencyWithCurrencyEffect = |
|
|
|
|
|
order.unitPriceFromMarketData?.mul(exchangeRateAtOrderDate ?? 1) ?? |
|
|
|
|
|
new Big(0); |
|
|
|
|
|
|
|
|
const valueOfInvestmentBeforeTransaction = totalUnits.mul( |
|
|
const valueOfInvestmentBeforeTransaction = totalUnits.mul( |
|
|
order.unitPriceInBaseCurrency |
|
|
marketPriceInBaseCurrency |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const valueOfInvestmentBeforeTransactionWithCurrencyEffect = |
|
|
const valueOfInvestmentBeforeTransactionWithCurrencyEffect = |
|
|
totalUnits.mul(order.unitPriceInBaseCurrencyWithCurrencyEffect); |
|
|
totalUnits.mul(marketPriceInBaseCurrencyWithCurrencyEffect); |
|
|
|
|
|
|
|
|
if (!investmentAtStartDate && i >= indexOfStartOrder) { |
|
|
if (!investmentAtStartDate && i >= indexOfStartOrder) { |
|
|
investmentAtStartDate = totalInvestment ?? new Big(0); |
|
|
investmentAtStartDate = totalInvestment ?? new Big(0); |
|
@ -558,10 +565,10 @@ export class RoaiPortfolioCalculator extends PortfolioCalculator { |
|
|
|
|
|
|
|
|
totalUnits = totalUnits.plus(order.quantity.mul(getFactor(order.type))); |
|
|
totalUnits = totalUnits.plus(order.quantity.mul(getFactor(order.type))); |
|
|
|
|
|
|
|
|
const valueOfInvestment = totalUnits.mul(order.unitPriceInBaseCurrency); |
|
|
const valueOfInvestment = totalUnits.mul(marketPriceInBaseCurrency); |
|
|
|
|
|
|
|
|
const valueOfInvestmentWithCurrencyEffect = totalUnits.mul( |
|
|
const valueOfInvestmentWithCurrencyEffect = totalUnits.mul( |
|
|
order.unitPriceInBaseCurrencyWithCurrencyEffect |
|
|
marketPriceInBaseCurrencyWithCurrencyEffect |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const grossPerformanceFromSell = |
|
|
const grossPerformanceFromSell = |
|
|