|
|
|
@ -922,7 +922,7 @@ export abstract class PortfolioCalculator { |
|
|
|
if (oldAccumulatedSymbol) { |
|
|
|
let investment = oldAccumulatedSymbol.investment; |
|
|
|
|
|
|
|
const newQuantity = quantity |
|
|
|
let newQuantity = quantity |
|
|
|
.mul(factor) |
|
|
|
.plus(oldAccumulatedSymbol.quantity); |
|
|
|
|
|
|
|
@ -948,9 +948,10 @@ export abstract class PortfolioCalculator { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Reset to zero if quantity is (almost) zero to avoid rounding issues
|
|
|
|
if (newQuantity.abs().lt(Number.EPSILON)) { |
|
|
|
// Reset to zero if quantity is (almost) zero to avoid rounding issues
|
|
|
|
investment = new Big(0); |
|
|
|
newQuantity = new Big(0); |
|
|
|
} |
|
|
|
|
|
|
|
currentTransactionPointItem = { |
|
|
|
|