Use OpenBB to subtract inflation from any stock gain.
By PyQuant News
Published: 2026-11-07
URL: https://pyquantnews.substack.com/p/your-15-return-was-really-11
Each week, I send out one Python tutorial to help you get started with algorithmic trading, market data analysis, and quant finance. Upgrade to a paid plan to access the Python code notebooks, Discord community, and code support.

Most people new to markets treat the number on the brokerage statement as the whole answer.
The account went up, so the year was a good one.
But prices for groceries and rent went up too.
So you end up ranking strategies by numbers that were never corrected for what the money could actually buy.
What you’ll build today
In today’s post, you’ll pull WMT’s share price and US inflation data with OpenBB, a Python package for market and economic data, then calculate the real return.
Let’s go.