gitmyhub

Divvy

Python ★ 1 updated 20d ago

Backtest your real investing history against a different portfolio and compare the dividends & returns you'd have earned. Replays your actual contribution calendar (or a synthetic DCA) into any basket of ETFs/stocks, with DRIP.

A backtesting tool that replays your real investing history into a different portfolio to show the dividends and returns you would have earned instead.

PythonCLIStreamlitYAMLsetup: easycomplexity 2/5

Divvy is a command line tool and web app for people who invest in dividend stocks and ETFs. It answers a specific question: if you had put the exact money you actually invested, on the exact dates you actually invested it, into a different portfolio, how much would you have earned in dividends and total return instead. Most backtesting tools online assume a clean, made-up contribution schedule like a fixed amount every month. Divvy is built around the idea that real investing is messy, since people skip months, add lump sums, or rebalance, so it replays your true contribution history rather than a synthetic one.

You can define one or more candidate portfolios, called buckets, either inline on the command line or in a YAML file listing tickers and target weights. Divvy compares these buckets side by side, showing total money contributed, total dividends received with reinvestment, the trailing twelve month dividend income, ending portfolio value, total return, and a money-weighted return called XIRR that accounts for when contributions happened. Every comparison also includes a benchmark, SPY by default, and a chart showing dividend income growth over time, not just a single lifetime number.

Contributions can come from a simple two-column CSV of dates and amounts, or Divvy can read real Fidelity account export files to work out your actual contribution calendar and actual dividends received automatically. There is also an optional feature to pull dividend income out of a Fidelity 1099 tax document, though that alone cannot drive a backtest since it does not show what you actually bought.

For people who prefer a visual tool over the command line, there is an interactive local web app where you can add and remove tickers, drag weight sliders, and watch the comparison table and charts update. It runs entirely on your own machine, so your financial data never has to leave your computer, and there is also a public demo running on made-up sample data.

Divvy is written in Python, installable through pip, and released under the MIT license, which allows free use, including commercial use, as long as the copyright notice is kept.

Where it fits