🐍 Why your forecasts break on new data


Most beginners model a whole time series at once (here's why that fails)

You sit down with a price chart or an economic indicator, build a model, and the predictions look solid on historical data.

Then you feed in new data and the results fall apart.

If that sounds familiar, you're not alone.

The problem usually isn't your model.

It's that you skipped a step professionals never skip.

Most financial and economic data contains several patterns layered on top of each other.

There's a long-term direction, a repeating seasonal pattern, and random noise.

When you try to model all of that as one thing, your model ends up fitting to the noise.

Studies consistently show that the majority of retail forecasting models fail on new data, and this is one of the biggest reasons why.

There's a structured way to handle this.

Before you build any forecast, you break the data into its separate pieces, study each one, and then decide how to model them.

That single habit is what separates models that work on new data from models that only look good in hindsight.

Once you can do this, you're much closer to building strategies you can actually test and run with real money.

Here's a Python example you can use now.

Assumes unemp is a pandas Series of monthly unemployment rates with a datetime index.

This code splits a single data series into three parts.

The trend shows the long-term direction (for example, unemployment falling steadily from 2010 to 2019).

The seasonal component captures repeating patterns that happen at the same time each year, like hiring cycles.

The residual is whatever is left over, the random noise. The noise ratio at the end tells you how much of the original data was just randomness. A low number means the decomposition captured most of the meaningful structure.

If the number is high, there's a lot of unexplained variation, and you'd want to investigate further before building a forecast on top of it.

Getting Started With Python for Quant Finance walks through this exact workflow and goes further. You learn how to take decomposed data and feed it into a strategy testing framework, so you can measure whether the patterns you found actually translate into profitable trades on data your model hasn't seen before.

Inside Getting Started With Python for Quant Finance

  • Step-by-step frameworks. Each module follows a structured process, so you always know what to do next instead of guessing which tutorial to watch.
  • 40 code templates. Ready-to-use Python scripts for tasks like pulling economic data, running decompositions, and testing strategies. You start from working code instead of a blank file.
  • Private community of 1,700+ Python traders. When you get stuck on a decomposition that doesn't look right or a model that won't run, you can ask people who've solved the same problem.

Together, these take you from staring at a confusing chart to running a tested strategy on real data.

What students are saying

⭐️ ⭐️ ⭐️ ⭐️ ⭐️
" A top-tier introduction to Python and quant finance. "
– Zac T

Your next steps

Start by pulling any time series you care about, whether that's unemployment, inflation, or a stock price.

Break it into trend, seasonal, and residual components using the code above.

Once you can see those pieces separately, you'll have a much clearer picture of what's real and what's noise.

From there, the natural next step is learning how to test whether those patterns hold up on new data.

A structured curriculum saves you months of trial and error.

Build forecasts that actually work on new data 👉

Learn the same decomposition and strategy testing workflow that professional trading desks use, then apply it to your own ideas with Python.


Jason Strimpel, founder of PyQuant News

Say 👋 on X/Twitter, LinkedIn, or book a call with me. You can always reply to these emails. I check them all

You got this email because you joined the PyQuant Newsletter or bought a product of mine.

You told me your email address is Reader.

Not right? Update your profile.

Want to stop getting these emails? No problem! Unsubscribe from all my emails.

Never investment advice. Use at your own risk. For educational purposes.

113 Cherry St #92768, Seattle, WA 98104

© 2026 PyQuant News, LLC

PyQuant Tips

For finance professionals, coders, and complete beginners. Automate your trading, investing, and data analysis with Python. No jargon, no fancy math, code you can use.

Read more from PyQuant Tips
Calculate the Hurst exponent in Python to detect trending or mean-reverting markets. Pick the right trading strategy.

EXCLUSIVE PARTNER DEAL FOR PYQUANT NEWS READERS: 15% off virtual private trading servers Host your trading algorithms on secure, low-latency environments. QuantVPS’s robust infrastructure lets you focus on perfecting your strategy, not babysitting your computer. Grab your 15% discount with this link 👉 Most traders use the same strategy no matter what the market is doing (here's how to know when to switch) You've probably found a strategy that looked great on a chart, then watched it bleed...

Smooth stock prices in Python with a Kalman filter. Replace arbitrary moving average windows with adaptive estimates.

EXCLUSIVE PARTNER DEAL FOR PYQUANT NEWS READERS: 15% off virtual private trading servers Host your trading algorithms on secure, low-latency environments. QuantVPS’s robust infrastructure lets you focus on perfecting your strategy, not babysitting your computer. Grab your 15% discount with this link 👉 Most beginners pick a moving average window that looks good on old data, then watch it fail on new data (here's how to fix that) You've probably spent time tweaking a moving average, trying 20...

Decompose portfolio risk with Python using the Fama-French factor model. Measure size and value exposure with OLS regression.

EXCLUSIVE PARTNER DEAL FOR PYQUANT NEWS READERS: 15% off virtual private trading servers Host your trading algorithms on secure, low-latency environments. QuantVPS’s robust infrastructure lets you focus on perfecting your strategy, not babysitting your computer. Grab your 15% discount with this link 👉 Most portfolios move with the market whether you want them to or not (here's how to measure it) You've picked a handful of stocks, maybe built a small portfolio, and you're watching it go up or...