🧪 We're running a cheminformatics notebook competition!

Enter by October 4
5 / 109
Country ETF vs FTSE All-World

Country ETF vs FTSE All-World

by marimo team

Blend single-country ETFs and compare their return against the FTSE All-World benchmark.

About this notebook

This marimo notebook builds a weighted portfolio from single-country ETFs and compares its return against the Vanguard FTSE All-World (VWCE) benchmark. You choose from ten country funds: Spain, the United Kingdom, France, Germany, the United States, Canada, Australia, Singapore, India, and Brazil. The notebook loads daily quotes with justetf-scraping, which reads the data from justETF, and it shapes and joins the series with polars. It writes each quote series to disk and reuses the cached copy until the next day, so repeat runs do not fetch the same data twice.

You pick the ETFs with a multiselect control. Each selected ETF then gets its own weight slider, and the notebook normalizes the slider values so they sum to one and set the mix. Move the pointer over the return chart to set the start date: every line re-bases to 0 percent at the date under the pointer, so you read the return from any start date you choose. A second chart shows each series as an underwater drawdown, the distance below its own running peak, so you can see the downside risk.

The re-base runs in the browser. The return chart is a Vega-Lite index chart with a point selection on the date axis, emitted as a raw spec so the selection stays inside the point layer, and the lookup and the percentage math run client-side with no round trip to Python. The quotes are cached as CSV files in a local etf-data directory next to the notebook.

Related notebooks