Fix live portfolio value calculation
This commit is contained in:
parent
4f17fb166d
commit
eb2e6b579a
@ -203,7 +203,11 @@ function getDisplayPnl(item: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getHoldingValue(item: any) {
|
function getHoldingValue(item: any) {
|
||||||
return firstNumber(item?.holding_value, getEffectiveQuantity(item) * getLastPrice(item));
|
const brokerValue = Number(item?.holding_value);
|
||||||
|
if (Number.isFinite(brokerValue) && brokerValue >= 0) {
|
||||||
|
return brokerValue;
|
||||||
|
}
|
||||||
|
return Math.abs(getEffectiveQuantity(item)) * Math.abs(getLastPrice(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPortfolioItemKey(item: any, idx: number) {
|
function getPortfolioItemKey(item: any, idx: number) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user