Summary
This chapter gave us some important tools needed to track live Goals, portfolios, and accounts. We started by reviewing the two main methods for calculating P&L and choosing to focus on TWRR.
We tested a Python implementation of TWRR on a few examples, before moving on to benchmarking. There, we used the familiar yfinance
module to retrieve price history data for the benchmark SPY ETF, as well as our portfolio. Step by step, we formatted our data to present it in a simple chart. Finally, we put together all our code into a reusable function.
The next chapter is going to be another exciting one, where we will discuss rebalancing. This functionality is often seen as the core of a Robo-advisor, so roll up your sleeves.