Skip to content

Fix for negative Unix timestamps on Windows#77

Open
gezmisozkan wants to merge 3 commits intorongardF:mainfrom
gezmisozkan:main
Open

Fix for negative Unix timestamps on Windows#77
gezmisozkan wants to merge 3 commits intorongardF:mainfrom
gezmisozkan:main

Conversation

@gezmisozkan
Copy link

Hi, I found an issue in timestamp parsing on Windows. When fetching symbols
with very old history (e.g. XAUUSD on OANDA), TradingView returns negative
Unix timestamps for pre-1970 data. datetime.fromtimestamp raises OSError on
Windows for negative values, causing get_hist to fail.

Replacing fromtimestamp with an epoch + timedelta(seconds) calculation fixes
the problem and works consistently across Windows, Linux, and macOS. I can
submit a PR if you’d like.

…stamps

on Windows and restore full historical XAUUSD data.
- Add TvDatafeed.get_quotes(symbols, timeout) using TradingView Quote Session (qsd parsing)
- Reuse one WebSocket connection for many symbols; handle timeouts and invalid symbols
- Ensure websocket cleanup (try/finally) and close connections after get_hist
- Add benchmark_realtime.py and document get_quotes + benchmark in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant