Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Assignment of Dates when pulling historical data #43

Open
AndyR88 opened this issue Mar 19, 2024 · 3 comments
Open

Wrong Assignment of Dates when pulling historical data #43

AndyR88 opened this issue Mar 19, 2024 · 3 comments

Comments

@AndyR88
Copy link

AndyR88 commented Mar 19, 2024

Hi,
I was pulling historical yield data with a daily resolution, for example:
DE10Y = tv.get_hist(symbol='DE10Y',exchange='TVC',interval=Interval.in_daily, n_bars=10)

which yields:
symbol open high low close volume
datetime
2024-03-05 22:00:00 TVC:DE10Y 2.323 2.362 2.311 2.330 0.0
2024-03-06 22:00:00 TVC:DE10Y 2.332 2.350 2.250 2.298 0.0
2024-03-07 22:00:00 TVC:DE10Y 2.290 2.297 2.233 2.272 0.0
2024-03-10 21:00:00 TVC:DE10Y 2.269 2.318 2.241 2.303 0.0
2024-03-11 21:00:00 TVC:DE10Y 2.303 2.342 2.275 2.325 0.0
2024-03-12 21:00:00 TVC:DE10Y 2.325 2.370 2.295 2.367 0.0
2024-03-13 21:00:00 TVC:DE10Y 2.367 2.437 2.357 2.436 0.0
2024-03-14 21:00:00 TVC:DE10Y 2.426 2.455 2.423 2.434 0.0
2024-03-17 21:00:00 TVC:DE10Y 2.436 2.468 2.429 2.455 0.0
2024-03-18 21:00:00 TVC:DE10Y 2.455 2.465 2.428 2.446 0.0

The values are correct but the dates are all shifted by one day, i.e. the last values in the df should be for 2024-03-19 (not the 18th), while 2024-03-17 has the values of 2024-03-18 bar when checking against the TradingView website. The 17th was a Sunday...
Am I calling the function incorrectly? Should I explicitly set a timezone? Or is it a bug?
Thank you!

@nicholasyoder
Copy link

I have also noticed this issue.

@silla30
Copy link

silla30 commented Apr 7, 2024

from tvDatafeed import TvDatafeed, Interval
tv = TvDatafeed()
index_data = tv.get_hist(symbol='NIFTY', exchange='NSE', interval=Interval.in_1_hour, n_bars=1000)

print(index_data)

ERROR:tvDatafeed.main:Connection is already closed.
ERROR:tvDatafeed.main:no data, please check the exchange and symbol
None

help

@nitin7478
Copy link

nitin7478 commented Oct 27, 2024

import pandas as pd
nifty.index = nifty.index + pd.Timedelta(hours=5, minutes=30)

#adjusted time offset using timedelta

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

No branches or pull requests

4 participants