Build a Robo Advisor with Python
Citation. Rob Reider and Alex Michalka. Build a Robo Advisor with Python (From Scratch): Automate your financial and investment decisions. Manning Publications, Manning Early Access Program (MEAP), version 6, 2023. An early-access draft, chapters 1 to 10, with code promised at github.com/RoboAdvisors. A mismatch: the issue names a different book, Ranin's Robo-Advisor with Python (Packt, 2023). The maintainer supplied this one for the issue, and this page reviews it. Not in this version: rebalancing, tax-loss harvesting, glide paths and withdrawal order. The text promises them for later chapters.
Status. Not applicable as a source of strategies. It teaches how to build an advisor's parts, and the PyPortfolioOpt and skfolio reviews already cover its optimisers. Its Monte Carlo method and its errors bear on the harness, and its inverse-volatility portfolio is already a benchmark there.
Read. Read on 2026-11-28 from the PDF that the maintainer supplied, 291 pages. I read all ten chapters in full, with the listings and tables. I checked the worked numbers in chapters 1, 2, 4, 6, 7 and 9 against the book's own formulas. I didn't run the listings, which download data from Yahoo Finance and FRED.
Summary
Claim. A robo-advisor's functions can be built in Python from open libraries. These are risk profiling, estimates of returns and risk, ETF selection, retirement simulation, asset location, performance reporting and portfolio optimisation.
Method. One topic per chapter, each with Python listings:
- Allocation. Markowitz's frontier, then mean–variance optimisation in CVXPY with constraints. Risk parity and hierarchical risk parity (HRP), then Black–Litterman.
- Inputs. Historical means, CAPM betas, GARCH volatility forecasts, and a check that a covariance matrix is positive definite.
- ETFs. A cost of ownership: the spread paid on a round trip plus the expense ratio over the holding period.
- Retirement. Monte Carlo of wealth with withdrawals, with guardrails on spending, inflation as an AR(1) process, fat tails, a bootstrap of past returns, and mortality tables.
- Asset location. Which assets go in taxable, tax-deferred and tax-exempt US accounts.
- Returns. Time-weighted and dollar-weighted returns, the Sharpe ratio, the information ratio and alpha.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| $100k for six months in an S&P 500 ETF (Table 4.5) | cost of ownership | IVV $19.59, VOO $20.01, SPLG $34.58, SPY $47.30 |
| $1.2M, spending 5% rising with 2% inflation, 6% mean and 12% volatility, 30 years | chance of running out | 48.09% |
| The same, with guardrails at 4% and 6% and a floor on spending | chance of running out | 28.04% |
| The same plan from age 60, with mortality tables and no fixed horizon | chance of running out | 36.86% |
| Daily S&P 500 returns, 1972–2021 | excess kurtosis | 19.67 |
| $10M deposited, +20%, $10M more, −10% | time-weighted, dollar-weighted | 3.92%, −0.66% |
| A 60/40 portfolio of stocks and bonds, no correlation | stocks' share of risk | over 97% |
| SUSA, an ESG ETF, against the S&P 500, 2005–2022 | monthly alpha and its p-value | −0.0004 (p 0.447) |
Where the claims go beyond the evidence
The resampling drops time. The bootstrap draws past years one at a time. The authors say that "the time series properties of returns like serial correlation will not be preserved". The repo's check on the Tharp page shows what that costs. Drawing one trade at a time understated a drawdown fourfold when regimes lasted. The book mentions a bootstrap of model residuals, but not a block bootstrap.
A worst case at the wrong quantile. Chapter 2's risk slider shows a "95% worst-case loss" at 1.96 standard deviations below the mean. That is the 2.5% tail. The 5% tail is 1.645 standard deviations.
A covariance formula that doesn't match the text. Listing 10.1's compute_posterior_cov adds A.T @ omega @ A. The book's own formula has Ω⁻¹ there. The crypto example then constrains volatility with that covariance, so its weights rest on the wrong matrix.
A unit error, and no test. Chapter 7 reports SUSA's alpha as "−0.04 bp/month". Its own regression gives −0.0004, which is −4 bp a month. The text calls the alpha "slightly negative" but doesn't say that it is far from significant (t −0.76).
Numbers that disagree. Chapter 6's text gives asset location a gain of "$625,042" or "0.55%/year". Its Table 6.2 gives $751,104, which is 0.58% a year over 30 years. One sentence says "bonds in the taxable account" where it means the IRA. Chapter 9's text says gamma was 10, while the listing sets 1.0.
Leverage without its cost. Chapter 9 levers risk parity up to the 60/40 portfolio's volatility and gets 4.36% against 3.5%. The expected returns are total returns, not excess returns. The comparison doesn't charge for borrowing. The book later says brokers charge "2-3% above the current risk-free rate". On 1.19 times the capital borrowed, that cost exceeds the gain of about 0.8 points.
Black–Litterman still concentrates. The sector example's optimised portfolio is 58.1% health care and 41.5% technology, from two views. The book presents the model as a defence against concentrated portfolios.
Credit. The authors state each assumption of their simulations, and show how each one changes the chance of running out. They say that historical means aren't used in practice, that mean–variance optimisation concentrates, and that their ESG fund is a survivor. They also say that the Sharpe ratio ignores the length of a track record.
Use in this repo
Inverse volatility is already a benchmark. The book's "naive risk parity" weights each asset by one over its volatility. harness.inverse_volatility is the same rule, and the harness reports it beside buy-and-hold and 1/N (#332). The book's HRP and Black–Litterman are in pyportfolioopt.md and skfolio.md, with the point that each setting is a trial.
Time-weighted returns for the paper-traded record. The harness runs a strategy with no deposits or withdrawals, so its return needs no weighting. A paper-traded portfolio with flows would need the time-weighted return to judge the strategy. The dollar-weighted return judges the timing of the flows. The book's example gives 3.92% against −0.66% on the same trades.
Simulate drawdown with blocks. The book's retirement simulation and Tharp's sizing simulation draw periods one at a time. bootstrap.py has circular and stationary block bootstraps, and any simulation of a path in the repo should use them.
A cheap ETF portfolio as the floor. The book's cost of ownership is a spread on a round trip plus the expense ratio over the holding period. A rebalanced ETF portfolio, after that cost and tax (#34), is the floor that a strategy has to beat. The harness's 1/N and inverse-volatility benchmarks charge the venue's costs, but no expense ratio. That is small for a large index ETF, at 0.03% a year.
US accounts don't transfer. Asset location assumes IRAs and Roth accounts. The repo's tax module covers five regimes (tax.py). New Zealand taxes foreign shares by the FIF rules (nz_fif.py), not by realised gains. So the book's ranking of assets by tax efficiency holds only for the US regime.