Book Review: Hands-On Financial Trading with Python

I was offered to read the second edition of Hands-On Financial Trading with Python by Cordell Tanny in exchange for an honest review. The author rebuilt this edition “around the workflow of a professional quantitative trader instead of a tour of Python libraries”. Many of the chapters use one case study: the VIXY tail hedge
The first chapter says that “Most beginners do not fail because they lack passion. They fail because they lack a process”, and many years ago I was exactly that beginner. I bet $100 on Forex and traded using Wolfe Waves (a chart pattern made of five waves). It worked at first, and I doubled my money, but I didn’t sell at the right time and lost all of it.
The overall structure

The eighteen chapters can be split into five groups:
- Foundations and data (Chapters 1-6): the Python workflow with generative AI as a coding copilot, data retrieval and preparation, exploratory analysis, and noise filtering from moving averages to Kalman filters and wavelets.
- Evaluation and validation (Chapters 7-11): performance metrics, backtesting with the bt and VectorBT libraries, out-of-sample testing, walk-forward analysis, and spotting a bad backtest.
- Forecasting and rules-based strategies (Chapters 12-13): ARIMA, logistic regression, and Prophet, then six strategies from Bollinger Band mean reversion to a Bitcoin moving-average system.
- Machine learning and LLM signals (Chapters 14-16): when machine learning is worth it, predicting large one-day drops in the S&P 500, and scoring Federal Reserve (FOMC) statements with an LLM.
- Deployment (Chapters 17-18): a GitHub repository and a daily scheduled job on PythonAnywhere that sends the target weights to Telegram.
What I liked

I liked that five chapters on evaluation and validation come before the chapters on strategies and machine learning. Chapter 7 says that before you write a single line of signal logic, you need to define what success looks like and how you will test whether it is real. Then it generates 100 strategies that flip a coin every day to choose between SPY and cash. Four of them reach a Sharpe ratio (return per unit of risk) above 1.0, and the best one beats the VIXY hedge built in the previous chapters.
I got the “define success” step wrong in a recent Kaggle Playground competition. The competition was scored on balanced accuracy, but the pipeline I built with a coding agent was validated on plain accuracy. With a strong class imbalance, the models favored the majority class. This mismatch was one of the two bugs that made the cross-validation score much higher than the leaderboard score.

The book also demonstrates lookahead bias (the trading version of data leakage). In Chapter 6, the author tells how his first signal-processing strategy had excellent backtest results, but after he added one more day of data, the trades from the previous week disappeared. Batch filters such as Fourier transforms and wavelets use the whole series, so new data changes their past values, while the Kalman filter only looks backward. The book’s test is simple: filter the VIX, add five days, filter again, and see where “the filter is rewriting history”.
Chapter 11 shows how such bias hides in a backtest. In a strategy that switches between stocks and bonds, the author normalizes the signal over the full sample on purpose. This flawed version gets the same verdict on every results-based check as the correct one, and only an audit of the signal itself finds the bug. In ML terms, this is fitting a scaler on the whole dataset before the train/test split.

The same chapter shows overfitting with a pair of heatmaps for a moving-average crossover on SPY (buy when a fast average crosses above a slow one). The best in-sample pair of windows is an isolated spike, and out of sample it becomes a middle-of-the-pack result: “It simply stopped being special”. The book suggests trusting a plateau rather than a peak, for example by taking the median parameters of all pairs whose results are close to the best one.
This is the public vs private leaderboard problem from Kaggle. In the ROGII competition, the public leaderboard didn’t fully correlate with my local validation. My best solo submission on the public leaderboard turned out worse on the private one than a submission that had looked noticeably weaker. Our team’s final submission held up much better and dropped only one place, from 92nd to 93rd, when the private leaderboard was revealed.
I also liked that the book reports negative results. Chapter 14 introduces four gates a problem has to pass before machine learning is worth it, such as enough data and being able to afford a model you don’t understand. Chapter 15 applies them to predicting a drop of 2% or more in SPY on the next day. The signal is real, but logistic regression captures it as well as a random forest, and it spots turbulence without telling which way the market will move. A fixed mix of SPY and bonds beats the model-driven strategy, and in the book’s words, “a correct no is the process working, not the process failing”.

I enjoyed reading Chapter 16, where an LLM scores the tone of FOMC statements. Before any tests, the book versions the prompt and checks that the scorer is stable by scoring the same statements ten times at temperature zero and comparing two providers. It also counts prompt rewrites as trials, because keeping the wording with the best backtest “is p-hacking conducted in English”. The tests then run on two free baselines that need no LLM (a word-count tone score and a text-similarity score), and neither predicts the market’s direction. The author even admits that he trusted convincing-looking tables from an earlier, incomplete run over the statistics, “because the tables agreed with what I already believed”.
What could have been better
A few small things I would have liked to see differently:
- Chapter 16 tests only the two free baselines, not the LLM’s own score.
- Bonferroni is the only multiple-testing correction the book applies, and the deflated Sharpe ratio would fit the coin-flip example well.
- The generative AI section covers only chat assistants, not coding agents that work directly in the repository.
But these are small nitpicks, completely overshadowed by the book’s strengths.
Conclusion
This book is a good fit for data scientists moving into financial markets, traders who want to move from manual to rule-based decisions, and students preparing for a career in quantitative finance. It assumes basic Python and finance fundamentals such as returns and volatility. Compared to the Python for Algorithmic Trading Cookbook that I reviewed in July, this book ends with a daily signal instead of live orders through a broker and spends more time deciding whether a result is real.
The main ideas of the book are: define success before you build, treat an impressive backtest as suspicious until it survives an audit, trust a plateau over a peak, and accept a clear “no” as the process working.
bookreview books python finance timeseries machinelearning evaluation