Replicate your ETFs with Alpaca and Google Spreadsheets

Monty Masters
3 min readJun 9, 2022

--

ETFs have become the passive-investing behemoth and it's a bit worrisome as ETF providers such as Vanguard and Blackrock now hold enormous stakes for their clients. Let’s see some drawbacks of ETFs.

  1. No Direct Voting Power
  2. Possible Fees
  3. Liquidity

A new buzzword has entered the investing sphere and that is Direct Indexing — a way to replicate all the benefits of an ETF including the additional benefit of tax-loss harvesting, and perhaps replicate an index without a corresponding ETF. After modifying the Google Spreadsheet from Alpaca, I would like to share something to fine-tune your investments away from ETFs. Much of the interface is similar to Alpaca’s spreadsheet. There are also triggers where rebalancing happens at a set interval subject. Be aware there are applicable quotas. Check it out here -

https://github.com/ProgramComputer/ReplicateETFGASheets.

Tutorial

Upload to Google Sheets and copy over the script files by selecting Apps Script.

Set the API keys from Alpaca in Account & Portfolio.

Next, in Create New Orders, set the CSV or XLSX URL of the holdings of the ETF and other options then hit setup. In this example, I used SPY. You’ll need to assign and authorize the scripts to make changes.

Another sheet will be created with the holding.

SPY has over 500 holdings and it’s possible to invest in each with fractional shares however, it’s 25 million considering the smallest holding has only 1 dollar. And it seems EMBC, is floating up the buy amount by a relatively large factor.

Perhaps another ETF would be better suitable. Below pick what you want, whether to buy, sell, or rebalance. I’m going to buy them anyway.

I was able to buy 217 of the holdings with $1000; $25000000 would have bought all the constituents with the smallest weight having $1 allocated.

Postscript

Tax-Loss Harvesting has not been added and neither has equal weights. Fiddle around and add it in. Currently, in the United States, up to $3000 can be used to offset ordinary income in a year. Try adding a filter to take the stocks from the ETF based on criteria. Special thanks to Google, and Alpaca, for providing the services needed and State Street Corporation for free info on SPY holdings. How long will this last; as long as Google and Alpaca exist, whichever comes first. Github contributions are welcome!

--

--

Monty Masters
Monty Masters

No responses yet