fix market price fetch in case symbols are missing
This commit is contained in:
parent
ff15d5cbc4
commit
ed731afc66
@ -172,10 +172,12 @@ export class PortfolioCalculator {
|
|||||||
if (!marketSymbolMap[date]) {
|
if (!marketSymbolMap[date]) {
|
||||||
marketSymbolMap[date] = {};
|
marketSymbolMap[date] = {};
|
||||||
}
|
}
|
||||||
|
if (marketSymbol.marketPrice) {
|
||||||
marketSymbolMap[date][marketSymbol.symbol] = new Big(
|
marketSymbolMap[date][marketSymbol.symbol] = new Big(
|
||||||
marketSymbol.marketPrice
|
marketSymbol.marketPrice
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let hasErrors = false;
|
let hasErrors = false;
|
||||||
const startString = format(start, DATE_FORMAT);
|
const startString = format(start, DATE_FORMAT);
|
||||||
@ -377,11 +379,13 @@ export class PortfolioCalculator {
|
|||||||
if (!marketSymbolMap[date]) {
|
if (!marketSymbolMap[date]) {
|
||||||
marketSymbolMap[date] = {};
|
marketSymbolMap[date] = {};
|
||||||
}
|
}
|
||||||
|
if (marketSymbol.marketPrice) {
|
||||||
marketSymbolMap[date][marketSymbol.symbol] = new Big(
|
marketSymbolMap[date][marketSymbol.symbol] = new Big(
|
||||||
marketSymbol.marketPrice
|
marketSymbol.marketPrice
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const results = [];
|
const results = [];
|
||||||
for (
|
for (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user