|
@ -1027,8 +1027,11 @@ export class PortfolioCalculator { |
|
|
valueAtStartDate = valueOfInvestmentBeforeTransaction; |
|
|
valueAtStartDate = valueOfInvestmentBeforeTransaction; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const transactionInvestment = order.quantity |
|
|
const transactionInvestment = |
|
|
.mul(order.unitPrice) |
|
|
order.type === 'BUY' |
|
|
|
|
|
? order.quantity.mul(order.unitPrice).mul(this.getFactor(order.type)) |
|
|
|
|
|
: order.quantity |
|
|
|
|
|
.mul(totalInvestment.div(totalUnits)) |
|
|
.mul(this.getFactor(order.type)); |
|
|
.mul(this.getFactor(order.type)); |
|
|
|
|
|
|
|
|
totalInvestment = totalInvestment.plus(transactionInvestment); |
|
|
totalInvestment = totalInvestment.plus(transactionInvestment); |
|
|