|
@ -16,6 +16,7 @@ import { FeeRatioInitialInvestment } from '@ghostfolio/api/models/rules/fees/fee |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service'; |
|
|
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; |
|
|
import { ImpersonationService } from '@ghostfolio/api/services/impersonation/impersonation.service'; |
|
|
import { ImpersonationService } from '@ghostfolio/api/services/impersonation/impersonation.service'; |
|
|
|
|
|
import { IDataProviderResponse } from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; |
|
|
import { |
|
|
import { |
|
|
DEFAULT_CURRENCY, |
|
|
DEFAULT_CURRENCY, |
|
@ -83,14 +84,13 @@ import { |
|
|
} from 'date-fns'; |
|
|
} from 'date-fns'; |
|
|
import { isEmpty, last, uniq, uniqBy } from 'lodash'; |
|
|
import { isEmpty, last, uniq, uniqBy } from 'lodash'; |
|
|
|
|
|
|
|
|
|
|
|
import { CurrentPositions } from './interfaces/current-positions.interface'; |
|
|
import { |
|
|
import { |
|
|
HistoricalDataContainer, |
|
|
HistoricalDataContainer, |
|
|
PortfolioPositionDetail |
|
|
PortfolioPositionDetail |
|
|
} from './interfaces/portfolio-position-detail.interface'; |
|
|
} from './interfaces/portfolio-position-detail.interface'; |
|
|
import { PortfolioCalculator } from './portfolio-calculator'; |
|
|
import { PortfolioCalculator } from './portfolio-calculator'; |
|
|
import { RulesService } from './rules.service'; |
|
|
import { RulesService } from './rules.service'; |
|
|
import { CurrentPositions } from './interfaces/current-positions.interface'; |
|
|
|
|
|
import { IDataProviderResponse } from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
|
|
|
|
|
|
|
|
|
const asiaPacificMarkets = require('../../assets/countries/asia-pacific-markets.json'); |
|
|
const asiaPacificMarkets = require('../../assets/countries/asia-pacific-markets.json'); |
|
|
const developedMarkets = require('../../assets/countries/developed-markets.json'); |
|
|
const developedMarkets = require('../../assets/countries/developed-markets.json'); |
|
@ -301,28 +301,21 @@ export class PortfolioService { |
|
|
dateRange, |
|
|
dateRange, |
|
|
impersonationId, |
|
|
impersonationId, |
|
|
portfolioOrders, |
|
|
portfolioOrders, |
|
|
transactionPoints, |
|
|
transactionPoints, |
|
|
userCurrency: this.request.user.Settings.settings.baseCurrency, |
|
|
userCurrency: this.request.user.Settings.settings.baseCurrency, |
|
|
userId, |
|
|
userId, |
|
|
calculateTimeWeightedPerformance: false, |
|
|
calculateTimeWeightedPerformance: false, |
|
|
withDataDecimation: false |
|
|
withDataDecimation: false |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
let investments: InvestmentItem[]; |
|
|
let investments = items.map( |
|
|
|
|
|
({ date, investmentValueWithCurrencyEffect }) => { |
|
|
if (groupBy) { |
|
|
|
|
|
investments = portfolioCalculator.getInvestmentsByGroup({ |
|
|
|
|
|
groupBy, |
|
|
|
|
|
data: items |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
investments = items.map(({ date, investmentValueWithCurrencyEffect }) => { |
|
|
|
|
|
return { |
|
|
return { |
|
|
date, |
|
|
date, |
|
|
investment: investmentValueWithCurrencyEffect |
|
|
investment: investmentValueWithCurrencyEffect |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
} |
|
|
} |
|
|
); |
|
|
|
|
|
|
|
|
let streaks: PortfolioInvestments['streaks']; |
|
|
let streaks: PortfolioInvestments['streaks']; |
|
|
|
|
|
|
|
@ -1596,8 +1589,8 @@ export class PortfolioService { |
|
|
start: startDate, |
|
|
start: startDate, |
|
|
end: endDate, |
|
|
end: endDate, |
|
|
step, |
|
|
step, |
|
|
calculateTimeWeightedPerformance} |
|
|
calculateTimeWeightedPerformance |
|
|
); |
|
|
}); |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
items, |
|
|
items, |
|
|