cmallwitz / Financials-Extension

Extension for LibreOffice Calc to access stock market data
Other
151 stars 21 forks source link

GETHISTORIC frequently fails to pull fresh data #83

Open khorton opened 1 year ago

khorton commented 1 year ago

GETHISTORIC is frequently failing to pull fresh data. Example: I have a sheet that uses GETHISTORIC to pull data for a range of dates, including today. GETHISTORIC will frequently fail to find fresh data even when there is data available for today after the market has closed. Once it gets stuck, I can wait for hours, and it remains wedged. Recalculate Hard does not unwedge it. It seems that the only way to unwedge it is to quit LibreOffice, then delete ~/.financials-extension/yahoo-VTSAX.*, then restart LibreOffice. This fixes the issue every time.

This issue is occurring on two computers with Financials-Extension v3.3.0 on LibreOffice 7.5.0 and 7.4.5 on MacOS Ventura 13.2.

Extract from trace.log from this morning - the correct value for yesterday (44960) is 101.16, but it returns None

2023-02-04 10:25:26.775960 getHistoric *args=('VTSAX', 91.0, 44958.0, 'YAHOO') r='100.669998' 0.143 ms
2023-02-04 10:25:26.776234 getHistoric *args=('VTSAX', 91.0, 44959.0, 'YAHOO') r='102.25' 0.143 ms
2023-02-04 10:25:26.776506 getHistoric *args=('VTSAX', 91.0, 44959.0, 'YAHOO') r='102.25' 0.142 ms
2023-02-04 10:25:26.776783 getHistoric *args=('VTSAX', 91.0, 44960.0, 'YAHOO') r='None' 0.146 ms

In case it matters, my formula is =IF(TYPE(GETHISTORIC(D$15,91,$A39,"YAHOO"))=1,GETHISTORIC(D$15,91,$A39,"YAHOO"),D38) where D$15 is "VTSAX" and A39 is the date for the query.