DEV Community

TildAlice
TildAlice

Posted on • Originally published at tildalice.io

yfinance to Polygon.io: 4 Breaking Changes in Migration

The Timezone Trap That Ate My Backtest

I spent two hours debugging phantom gains in a momentum strategy before realizing yfinance and Polygon.io handle market timestamps differently. yfinance returns datetime64[ns] with naive UTC timestamps. Polygon returns timezone-aware America/New_York timestamps. When you merge dataframes from both sources, pandas silently coerces them to a common timezone — and your bar alignment breaks.

This isn't just an annoyance. If you're migrating a production system that assumes all timestamps are UTC, every single join, resample, and lookback window needs adjustment.

Polygon.io's free tier gives you 5 API calls per minute and delayed data. The paid Basic tier ($29/month as of 2026) unlocks real-time bars and 100 calls/minute. For most retail algo strategies, that's enough. But if you're running high-frequency scans across 500+ tickers, you'll hit rate limits fast.

Here's what actually breaks when you swap the data source.

Two Canada geese flying gracefully in a bright sky, showcasing natural migration patterns.

Photo by Chris F on Pexels

API Call Structure: From One-Liner to Explicit Parameters


Continue reading the full article on TildAlice

Top comments (0)