|
@ -199,21 +199,9 @@ export class PortfolioCalculator { |
|
|
}) ?? []; |
|
|
}) ?? []; |
|
|
|
|
|
|
|
|
const currencies: { [symbol: string]: string } = {}; |
|
|
const currencies: { [symbol: string]: string } = {}; |
|
|
const dates: Date[] = []; |
|
|
|
|
|
const dataGatheringItems: IDataGatheringItem[] = []; |
|
|
const dataGatheringItems: IDataGatheringItem[] = []; |
|
|
const firstIndex = transactionPointsBeforeEndDate.length; |
|
|
const firstIndex = transactionPointsBeforeEndDate.length; |
|
|
|
|
|
|
|
|
let day = start; |
|
|
|
|
|
|
|
|
|
|
|
while (isBefore(day, end)) { |
|
|
|
|
|
dates.push(resetHours(day)); |
|
|
|
|
|
day = addDays(day, step); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!isSameDay(last(dates), end)) { |
|
|
|
|
|
dates.push(resetHours(end)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (transactionPointsBeforeEndDate.length > 0) { |
|
|
if (transactionPointsBeforeEndDate.length > 0) { |
|
|
for (const item of transactionPointsBeforeEndDate[firstIndex - 1].items) { |
|
|
for (const item of transactionPointsBeforeEndDate[firstIndex - 1].items) { |
|
|
dataGatheringItems.push({ |
|
|
dataGatheringItems.push({ |
|
@ -226,10 +214,12 @@ export class PortfolioCalculator { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { dataProviderInfos, values: marketSymbols } = |
|
|
const { dataProviderInfos, values: marketSymbols } = |
|
|
await this.currentRateService.getValues({ |
|
|
await this.currentRateService.getValueRange({ |
|
|
dataGatheringItems, |
|
|
dataGatheringItems, |
|
|
dateQuery: { |
|
|
dateRange: { |
|
|
in: dates |
|
|
start, |
|
|
|
|
|
end, |
|
|
|
|
|
step |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -322,9 +312,7 @@ export class PortfolioCalculator { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (const currentDate of dates) { |
|
|
for (const dateString of Object.keys(marketSymbolMap)) { |
|
|
const dateString = format(currentDate, DATE_FORMAT); |
|
|
|
|
|
|
|
|
|
|
|
for (const symbol of Object.keys(valuesBySymbol)) { |
|
|
for (const symbol of Object.keys(valuesBySymbol)) { |
|
|
const symbolValues = valuesBySymbol[symbol]; |
|
|
const symbolValues = valuesBySymbol[symbol]; |
|
|
|
|
|
|
|
|