alvarobartt / investiny

🤏🏻 `investpy` but made tiny
https://alvarobartt.github.io/investiny
MIT License
280 stars 32 forks source link

Issue with Date and Price mapping #51

Closed KapsTrvl closed 1 year ago

KapsTrvl commented 1 year ago

from #40 Hi @alvarobartt .. updated investiny version however ran into some issues -- image

The output is missing 10/14 (Friday) and displaying 10/15, prices off by a day. This is for DXY. image

alvarobartt commented 1 year ago

Thanks for reporting this, I may create a label for all the date-related issues... Let me check in detail! Anyway, why there is information for 10/16/2022 which is actually a Sunday?

alvarobartt commented 1 year ago

Soooo @KapsTrvl this is what I can see:

>>> from investiny import search_assets
>>> res = search_assets(query="DXY")
>>> print(res)
[{'symbol': 'DXY', 'full_name': 'NYSE:DXY', 'description': 'US Dollar Index', 'type': 'Index', 'ticker': '942611', 'exchange': 'NYSE'}, {'symbol': 'DXYN', 'full_name': 'NASDAQ:DXYN', 'description': 'The Dixie Group Inc', 'type': 'Stock', 'ticker': '15953', 'exchange': 'NASDAQ'}]
>>> from investiny import historical_data
>>> d = historical_data(investing_id=942611)
>>> d["date"]
['09/19/2022', '09/20/2022', '09/21/2022', '09/22/2022', '09/23/2022', '09/26/2022', '09/27/2022', '09/28/2022', '09/29/2022', '09/30/2022', '10/03/2022', '10/04/2022', '10/05/2022', '10/06/2022', '10/07/2022', '10/10/2022', '10/11/2022', '10/12/2022', '10/13/2022', '10/14/2022', '10/16/2022', '10/17/2022']

so everything looks good to me, at least according to the information provided by Investing.com at https://www.investing.com/indices/usdollar-historical-data

alvarobartt commented 1 year ago

FYI same code as above, but using also the from_date and to_date args, so make sure that you're using the latest investiny version which is currently 0.7.1 as you can see at https://github.com/alvarobartt/investiny/releases/tag/v0.7.1

>>> from investiny import historical_data
>>> d = historical_data(investing_id=942611, from_date="10/02/2022", to_date="10/17/2022")
>>> d["date"]
['10/03/2022', '10/04/2022', '10/05/2022', '10/06/2022', '10/07/2022', '10/10/2022', '10/11/2022', '10/12/2022', '10/13/2022', '10/14/2022', '10/16/2022', '10/17/2022']
KapsTrvl commented 1 year ago

DXY starts ticking Sunday evening (NY Time- EST), so investing.com seems to be displaying accordingly. I am using the latest version, ran the command you gave in the previous ticket. Did it once more, however same issue again .. image

Likely time zone from where user initiating the call causing the issue (I am running it from new york time zone)

alvarobartt commented 1 year ago

DXY starts ticking Sunday evening (NY Time- EST), so investing.com seems to be displaying accordingly. I am using the latest version, ran the command you gave in the previous ticket. Did it once more, however same issue again ..

image

Likely time zone from where user initiating the call causing the issue (I am running it from new york time zone)

So timezones again... let me check tomorrow morning to see whether I can fix the issue. A simple conversion to UTC should work, but not sure, let's check tomorrow!