Equity Portfolio: Page Overview
As I was thinking about where to begin here, I thought taking a look at my purchases by year is as good a place as any. I don't want to show actual $s on here, happy to talk about that offline if you're curious.
So what I've put below is a brief accounting of the equities I've bought and how they've performed. Clearly, this remains a WIP (#buildinpublicslowly).
Quick summary of tools used:
-
Portfolio data from markets.sh (love this site, pretty cool team behind it too).
-
Price data from fmpcloud.io (no backlink, not the best API).
-
Dividends data from good ol yfinance.
-
Ticker information (sector, name, IPO date, etc.) from discountingcashflows.com.
-
Data notebook for python and sql hex.tech (I'll share the notebooks one day, right now it's like my room when I was 15).
-
Data Warehouse - GCP BigQuery.
Quick summary of methodology:
-
Data starts at purchase date and ends at sell date (if applicable).
-
Return is calculated by combining price and dividend changes per share
-
Way harder to do than it sounds - I couldn't find this functionality in any online tool that combines portfolios. So I built it myself.
-
-
Rate of return is calculated with this:
-
(INVESTMENT + (SUM(RETURN_PER_SHARE) * QUANTITY)) / INVESTMENT) - 1 AS return_percentage
-
-
Annualized rate of return is calculated with this:
-
ROUND(POW((ra.INVESTMENT + ra.return_absolute) / ra.INVESTMENT, (1.0 / ra.AGE_YEARS)) - 1, 2) AS annualized_rate_of_return
-
-
And finally, Market Cap Categories are calculated with this:
-
CASE
WHEN ci.MKTCAP >= 200000000000 THEN 'Mega-cap'
WHEN ci.MKTCAP >= 10000000000 THEN 'Large-cap'
WHEN ci.MKTCAP >= 2000000000 THEN 'Mid-cap'
WHEN ci.MKTCAP >= 300000000 THEN 'Small-cap'
WHEN ci.MKTCAP >= 50000000 THEN 'Micro-cap'
ELSE 'Nano-cap'
END AS market_cap_category
-