**Justification**
My main portfolio is on MOEX, so I need a way to manage it. Ghostfolio looks
cool but there's no way to proper manage assets on MOEX. So, first I've found
`moex-iss-api` npm package. Turns out it needed some help, so couple of PR
there. After that I was ready to work on ghostfolio.
This commit implements full `DataProviderInterface` spec:
- Disabled by default, so only those who need it would enabled it.
- We `canHandle` all symbols
- We aren't premium feature
- `getQuotes`, `getHistorical` and `search` were pretty straightforward
- `getTestSymbol` return `SBER` because if something happens to `SBER` stocks
then MOEX would definetely doesn't matter anymore for sometime.
- `getAssetProfile` and `getDividends` proved to be tricky to implement, so
I'll cover them below separately.
**getAssetProfile**
**Currency**
This is main method to get info about assets. Unfortunately, due to fall of
USSR and ruble denomination in 1998, we have three currency tickers: 'RUR',
'SUR', 'RUB' For convenience we use 'RUB' instead of all of them. I don't see
practical value to differentiate between them here, but I'm open to suggestions.
Also, some of the tickers do not return currency in which they're listed on
MOEX. Assumed that it's also 'RUB'.
**Name**
Every asset can have several things to identify it. And all of them are
optional in MOEX API, except `secid` which is `Security ID`. So we use them
for name in this order of preference:
1. Latin (usually English) name.
2. Latin short name.
3. Russian name.
4. Security ID.
**Country**
I try to detect country, parsing ISIN: first two letters should be country code.
**Sectors**
MOEX supports some industry related indices, so when we first encounter some
symbol, I check whether it's in those indices and assign sectors accordingly.
**AssetClass and AssetSubClass**
At first, I was tempted to leave them empty, but finally decided to look into.
I downloaded all asset types from MOEX and tried to best of my knowledge assign
asset classes and subclasses. If I wasn't able to find proper relation, I left
the cell empty. After that I took the table (you can check it in the comments
in the code) and made `SecurityTypeMap` interface.
**getDividends**
MOEX API for dividends isn't documented at all (or probably I didn't find
proper docs) and sometimes it doesn't return the newest dividends. Surprisingly,
you can get dividends for MOEX-related assets from YAHOO, but the date can
differ. So, there is heurestic implemented: if those date are no more than two
days apart and payout is the same, then it's the exact same payout and we
merge them.
Signed-off-by: Anatoly Popov <me@aensidhe.ru>
* fix(lib): update displayedColumns type
* feat(lib): use input function for holdings
* feat(lib): make isLoading a computed signal
* feat(lib): make paginator and sort viewchild signals
* feat(lib): make dataSource a computed signal
* feat(lib): use input function for hasPermission fields
* feat(lib): make displayedColumns a computed signal
* feat(lib): remove ngOnChanges
* feat(lib): update types in holdings mock
* fix(lib): update imports for treemap chart component
* fix(lib): remove unused routeQueryParams variable
* fix(lib): prevent creating new table data source every time the signal changes
* fix(lib): remove unused unsubscribe subject as there is no observable subscription
* fix(lib): revert changes to dataSource in the template
* fix(lib): changed locale to input signal
* fix(lib): change ignoreAssetSubClasses to protected
* fix(lib): create canShowDetails function
* fix(lib): remove unused baseCurrency and deviceType inputs
* fix(lib): remove unused baseCurrency and deviceType inputs from stories
* feat(lib): make constructor as public
* fix(lib): prevent table data source to be created every time
* fix(lib): remove unused unsubscribeSubject variable
* fix(lib): change to protected methods
* feat(lib): change locale to signal input
* feat(lib): remove unused deviceType input
* feat(lib): change hasPermissionToOpenDetails to signal input
* feat(lib): change showFooter to signal input
* feat(lib): change activitiesCount to signal input
* feat(lib): change baseCurrency to signal input
* feat(lib): change totalBalanceInBaseCurrency to signal input
* feat(lib): change totalValueInBaseCurrency to signal input
* feat(lib): change outputs to signal outputs
* Adapt accounts and tags of assistant in impersonation mode
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>