Browse Source

Fix issue on buy date

pull/297/head
Thomas 4 years ago
parent
commit
d4199f9928
  1. 6
      apps/api/src/app/portfolio/portfolio.service.ts

6
apps/api/src/app/portfolio/portfolio.service.ts

@ -337,10 +337,10 @@ export class PortfolioService {
);
const historicalDataArray: HistoricalDataItem[] = [];
let maxPrice = orders[0].unitPrice;
let minPrice = orders[0].unitPrice;
let maxPrice = Math.max(orders[0].unitPrice, marketPrice);
let minPrice = Math.min(orders[0].unitPrice, marketPrice);
if (!historicalData[aSymbol][firstBuyDate]) {
if (!historicalData?.[aSymbol]?.[firstBuyDate]) {
// Add historical entry for buy date, if no historical data available
historicalDataArray.push({
averagePrice: orders[0].unitPrice,

Loading…
Cancel
Save