|
|
@ -1163,16 +1163,12 @@ export class PortfolioService {
|
|
|
|
|
|
|
|
|
|
|
|
for (const symbol of Object.keys(cashPositions)) {
|
|
|
|
for (const symbol of Object.keys(cashPositions)) {
|
|
|
|
// Calculate allocations for each currency
|
|
|
|
// Calculate allocations for each currency
|
|
|
|
cashPositions[symbol].allocationCurrent = new Big(
|
|
|
|
cashPositions[symbol].allocationCurrent = value.gt(0)
|
|
|
|
cashPositions[symbol].value
|
|
|
|
? new Big(cashPositions[symbol].value).div(value).toNumber()
|
|
|
|
)
|
|
|
|
: 0;
|
|
|
|
.div(value)
|
|
|
|
cashPositions[symbol].allocationInvestment = investment.gt(0)
|
|
|
|
.toNumber();
|
|
|
|
? new Big(cashPositions[symbol].investment).div(investment).toNumber()
|
|
|
|
cashPositions[symbol].allocationInvestment = new Big(
|
|
|
|
: 0;
|
|
|
|
cashPositions[symbol].investment
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.div(investment)
|
|
|
|
|
|
|
|
.toNumber();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return cashPositions;
|
|
|
|
return cashPositions;
|
|
|
|