|
|
@ -9,6 +9,7 @@ import { Market } from '@ghostfolio/common/types';
|
|
|
|
|
|
|
|
|
|
|
|
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
|
|
|
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
|
|
|
|
import { AssetClass } from '@prisma/client';
|
|
|
|
import { StatusCodes } from 'http-status-codes';
|
|
|
|
import { StatusCodes } from 'http-status-codes';
|
|
|
|
import { isNumber } from 'lodash';
|
|
|
|
import { isNumber } from 'lodash';
|
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
|
@ -145,6 +146,9 @@ export class PublicPageComponent implements OnInit {
|
|
|
|
value: position.allocationInPercentage
|
|
|
|
value: position.allocationInPercentage
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (position.assetClass !== AssetClass.LIQUIDITY) {
|
|
|
|
|
|
|
|
// Prepare analysis data by continents, countries, holdings and sectors except for liquidity
|
|
|
|
|
|
|
|
|
|
|
|
if (position.countries.length > 0) {
|
|
|
|
if (position.countries.length > 0) {
|
|
|
|
this.markets.developedMarkets.value +=
|
|
|
|
this.markets.developedMarkets.value +=
|
|
|
|
position.markets.developedMarkets * position.valueInBaseCurrency;
|
|
|
|
position.markets.developedMarkets * position.valueInBaseCurrency;
|
|
|
@ -164,18 +168,21 @@ export class PublicPageComponent implements OnInit {
|
|
|
|
name: continent,
|
|
|
|
name: continent,
|
|
|
|
value:
|
|
|
|
value:
|
|
|
|
weight *
|
|
|
|
weight *
|
|
|
|
this.publicPortfolioDetails.holdings[symbol].valueInBaseCurrency
|
|
|
|
this.publicPortfolioDetails.holdings[symbol]
|
|
|
|
|
|
|
|
.valueInBaseCurrency
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.countries[code]?.value) {
|
|
|
|
if (this.countries[code]?.value) {
|
|
|
|
this.countries[code].value += weight * position.valueInBaseCurrency;
|
|
|
|
this.countries[code].value +=
|
|
|
|
|
|
|
|
weight * position.valueInBaseCurrency;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.countries[code] = {
|
|
|
|
this.countries[code] = {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
value:
|
|
|
|
value:
|
|
|
|
weight *
|
|
|
|
weight *
|
|
|
|
this.publicPortfolioDetails.holdings[symbol].valueInBaseCurrency
|
|
|
|
this.publicPortfolioDetails.holdings[symbol]
|
|
|
|
|
|
|
|
.valueInBaseCurrency
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -201,7 +208,8 @@ export class PublicPageComponent implements OnInit {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
value:
|
|
|
|
value:
|
|
|
|
weight *
|
|
|
|
weight *
|
|
|
|
this.publicPortfolioDetails.holdings[symbol].valueInBaseCurrency
|
|
|
|
this.publicPortfolioDetails.holdings[symbol]
|
|
|
|
|
|
|
|
.valueInBaseCurrency
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -209,6 +217,7 @@ export class PublicPageComponent implements OnInit {
|
|
|
|
this.sectors[UNKNOWN_KEY].value +=
|
|
|
|
this.sectors[UNKNOWN_KEY].value +=
|
|
|
|
this.publicPortfolioDetails.holdings[symbol].valueInBaseCurrency;
|
|
|
|
this.publicPortfolioDetails.holdings[symbol].valueInBaseCurrency;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.symbols[prettifySymbol(symbol)] = {
|
|
|
|
this.symbols[prettifySymbol(symbol)] = {
|
|
|
|
name: position.name,
|
|
|
|
name: position.name,
|
|
|
|