Joel Alcedo Profile picture
Feb 7 5 tweets 3 min read
3yrs ago, I uploaded econ/finance R coding tutorials but never kept up with it

I recently discovered one reached 5,000 views - surprising to me

Inspired these could help others, I'm giving it another go, will try to upload 1x/month

Here's a new vid!👇

In this tutorial, you'll learn how to:

1. scrape historical #cryptocurrency and #stock price data

2. calculate daily returns

3. identify uncorrelated assets using a hierarchical clustering algorithm

4. backtest an uncorrelated portfolio of stocks against a correlated one Image
Why does this matter?

Stocks, currencies, bonds - basically any asset - can go up/down for the same reasons (eg. same macro factors, policies, a pandemic)

An uncorrelated/diversified portfolio is an important tool to improving the likelihood of better risk-adjusted returns Image
An analogy

Strawberry jam & jelly are different foods made of the same fruit

If you only eat jam and jelly, you'd likely end up with strange health issues

Stomach space is finite - efficiently allocating a broad range of nutrients mitigates the risk of health issues 😀 Image
The very basic implementation in the tutorial illustrates diversified portfolios tend to have favorable sharpe ratios and annual returns compared to a highly correlated portfolio. Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Joel Alcedo

Joel Alcedo Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @joelalcedo1

Feb 9
With CPI coming out tomorrow and product weights getting an update, thought I’d dig into this and share what I found.

As with any survey-based datasets, there's nuance.

Here’s more than you wanted to know about food cpi. I’ll focus on food at home & food away from home. Image
Food at home is mainly comprised of stuff you find at the grocery store – the chart below shows the main sub-components.

During the time of survey, every item in food at home is measured in a specified unit of size (eg. price per pound, gallon, etc.) Image
The BLS measures prices primarily by sending out field staff to grocery stores, warehouse clubs, anywhere with these food items, across the US. While at the grocery store, they collect price data in a couple ways depending on the item.
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

:(