cachefinance icon indicating copy to clipboard operation
cachefinance copied to clipboard

More supported attributes

Open ewoks opened this issue 2 years ago • 2 comments

Currently supported: attribute - three supported attributes for now "price", "yieldpct", "name".

If I understood the script flow correctly, firstly it is attempted to use GOOGLEFINANCE and if that fails, scripts will try cache, than other resources.

I understand, that other sources require implementations for more than 3 listed attributes, but not sure why further GOOGLEFINANCE attributes are not available, namely: low52, high52, pe, eps ? Trying to use cachefinance() with one of these attributes renders error "invalid attribute" as script tries to pull it from yahoo, but I am not sure if there was attempt to get it from GOOGLEFINANCE first. My impression is that it goes first to yahoo, as using cachefinance with low52 always returns error, but with googlefinance directly, at the moment of my tests it gets the values.

Could you please confirm this, maybe my logic is wrong? My current workaround is to use it as: =CACHEFINANCE("Ticker", "low52", GOOGLEFINANCE("Ticker", "low52"))

Thanks

ewoks avatar Feb 25 '23 13:02 ewoks

Hey Ewoks,

The only reason I had those 3 attributes supported, is that I was attempting to screen scrape from other websites for ticker symbols that are not supported through GoogleFinance. For some reason, many Canadian symbols have no support. There are even some U.S. symbols that have been around for a while that are not supported. So the reason that it is just PRICE, YIELDPCT and NAME is that those are the only things I was using.

The CacheFinance() function for other attributes will not extract this data from any 3rd party website, so would require a valid GoogleFinance default value at the start. Your workaround is correct, I need to look at the code again and update the documentation for using the other attributes.

I think that the only issue is for ticker symbols that always return an error. The 3rd party lookup will never resolve and always return "ERROR". Like this symbol always fails:

=CACHEFINANCE("TSE:XGGB","low52", GOOGLEFINANCE("TSE:XGGB", "low52"))

demmings avatar Mar 06 '23 18:03 demmings

Ewoks,

Made a small change so that an error is not thrown for the case of attributes where we don't lookup 3'rd party website data and no default value was set.

demmings avatar Mar 06 '23 19:03 demmings