diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 9de48ead4..ec058d7b6 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -311,13 +311,13 @@ export class PortfolioService { averagePrice, currency, firstBuyDate, - marketPrice, quantity, transactionCount } = position; - // Convert investment and gross performance to currency of user const userCurrency = this.request.user.Settings.currency; + + // Convert investment and gross performance to currency of user const investment = this.exchangeRateDataService.toCurrency( position.investment.toNumber(), currency, @@ -329,6 +329,13 @@ export class PortfolioService { userCurrency ); + // Convert market price to currency of position + const marketPrice = this.exchangeRateDataService.toCurrency( + position.marketPrice, + userCurrency, + currency + ); + const historicalData = await this.dataProviderService.getHistorical( [aSymbol], 'day',