Ticker symbols supported by googlefinance function - regex

The GOOGLEFINANCE function in Google Sheets allows you to lookup the price (or other attribute) of a stock or instrument.
https://support.google.com/docs/answer/3093281?hl=en
However, the documentation for which symbols it supports is sparse.
For example, this fund has a symbol "GB00B59G4Q73", and searching for this in Yahoo finance works.
But neither this nor the symbol "0P0000KSP6.L" works in Google Sheets, giving the error "When evaluating GOOGLEFINANCE, the query for the symbol: 'GB00B59G4Q73' returned no data."
How can I determine if I am using the correct symbol, or if the function does not support this symbol?

here is your "official documentation":
ticker - The ticker symbol for the security to consider.
Note: Reuters Instrument Codes are no longer supported. For example, ticker 123.TO or XYZ.AX would not work. Instead, use TSE:123 or ASX:XYZ.
Recommended: Add an exchange to avoid discrepancies. For example, use “NASDAQ:GOOG” instead of “GOOG." If an exchange is not specified, GOOGLEFINANCE will use its best judgement to choose one for you.
meaning that the best you can do is to go to https://www.google.com/finance and search for your ticker there instead of yahoo or other suppliers that are not supported
but you can always scrape it from yahoo:
=SUBSTITUTE(SPLIT(REGEXEXTRACT(QUERY(IMPORTXML(
"https://uk.finance.yahoo.com/quote/0P0000KSP6.L?p=0P0000KSP6.L&.tsrc=fin-srch", "//*"),
"select Col1
where Col1 contains 'Vanguard FTSE Dev World ex UK Equity Index AccLSE - LSE'
limit 1
offset 8", 0), "GBp(.*)"), "-"), ",", )*1

Related

Dividend history from Yahoo finance

Is there a convenient way to obtain dividend history for a specified company from the Yahoo finance API? For example, the historic data can be obtained by the following link, with some variable conditions
https://query1.finance.yahoo.com/v7/finance/download/code_name?period1=from&period2=to&interval=1d&events=history
Which, with those conditions filled, would look like:
https://query1.finance.yahoo.com/v7/finance/download/CBA.AX?period1=0&period2=1625841418&interval=1d&events=history
Which gives the data as Date Open High Low Close AdjClose Volume. What I would like to obtain is this, but for dividends. I.e. Date Amount in a specified period.
You can get the past dividends for, say Apple, using this query
https://finance.yahoo.com/quote/AAPL/history?period1=from&period2=to&interval=div%7Csplit&filter=div&frequency=1d&includeAdjustedClose=true
To get the csv file, use this for Apple
https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=From&period2=To&interval=1d&events=div&includeAdjustedClose=true
Try this for the dividends during last year again using Apple as an example
https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1594598400&period2=1626134400&interval=1d&events=div&includeAdjustedClose=true
You can use R to get dividend information quite easily.
If you want the information from Yahoo then use quantmod library. The function to use is getDividends("CBA.AX")
library(quantmod)
getDividends("CBA.AX")

GOOGLEFINANCE - How to get Amsterdam data?

I want to get market data for the shares listed in Euronext Amsterdam (for example 'Royal Dutch Shell plc (RDSB.AS)'). Google's Finance Data Listing says that for the Euronext Amsterdam the symbol 'AMS' needs to be used as a prefix for a ticker.
When I am using the following command...
=GOOGLEFINANCE("AEX:RDSB"; "price")
...then I am getting the error message:
"When evaluating GOOGLEFINANCE, the query for the symbol: 'RDSB' returned no data."
So, what's wrong with my code? Isn't it possible to get the Amsterdam Stock Exchange market data? If so, then why the Euronext Amsterdam is listed in exchanges list?
Everything works fine for the London Stock Exchange:
=GOOGLEFINANCE("LON:RDSB"; "price")
You gave your own answer: "Google's Finance Data Listing says that for the Euronext Amsterdam the symbol 'AMS' needs to be used as a prefix for a ticker."
Use AMS instead of AEX.
=GOOGLEFINANCE("AMS:RDSB"; "price")

How to specify the currency for GoogleFinance historical data

I'm having a problem using Google Finance historical data. I need to know the price a particular stock had on a particular date (Usually within the last month).
The problem is, when I use a URL such as https://finance.google.com/finance/historical?q=abx I get different results depending on where I issue the query from.
At home I'm in Argentina and my production server is in the US... when I run the query locally I get the prices in AR$, but when run from the server I get USD (Which is what I actually need).
I tried using a X-Forwared-For header but didn't make a difference...
Ideally I'd like to send an extra parameter (something like cur=USD) to explicitly ask for USD... is there such a thing?
Thanks
I use, currency conversion along with the price of the stock.
For Example:
Price of ABB Ltd in SEK = GOOGLEFINANCE("ABB","price") * GOOGLEFINANCE(("CURRENCY:USDSEK"))
Then I format the cells, rows, columns with prices to local currency(i.e. SEK) as mentioned in the link: Format Numbers in excel.
You could add other parameters such as date as mentioned in below link:
Get exchange rate on a specific date from GoogleFinance

SAS Fuzzy Lookup

I'm trying to do a fuzzy lookup on two datasets in SAS. I have searched over google and found the below link which explains the process of doing the fuzzy lookup in SAS.
Link: http://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/
To explain in detail the problem, the two datasets contains information of Hospital names and other additional information. I have to match both the data sets based on Hospital names. But the main challenge is in some cases I have the hospital name as follows:
Dataset1(hospital Name): St.Hospital
Dataset2(hospital Name): Saint.Hospital
Like wise INC and Incorporated.
I would like to know is there any best way to do the fuzzy lookup in SAS.
Thanks,
VJ
There can't be any single best way to do a fuzzy lookup, as the article you linked to explains. You have to decide on the best approach for your particular problem domain and your particular tolerances for false positives and false negatives, etc.
For your data, I would probably just define a set of 'best guess' transformations on the hospital name in both input data sets, and then do a standard merge on the transformed names. The transformations would be something like:
Convert to uppercase
Convert 'ST.' or 'ST ' to 'SAINT' (or should that be 'STREET'??)
Convert 'INC' or 'INC.' to 'INCORPORATED'
Convert any other known common strings as above
Remove any remaining punctuation
Use COMPBL to reduce multiple spaces to a single space
Do the merge
You will then have to examine the result and decide if it's good enough for your purposes. There is no general way for a computer to match up two strings that might be arbitrarily badly-spelled, particularly if there are multiple possible 'correct' matches - this is the same problem that spell-checkers have been trying to solve for decades - there's no way of knowing (in isolation) whether a misspelled word like 'falt' was meant to be 'fault', 'fall', 'fast', 'fat' etc.
If your results have to be perfect, you will need a human to review anything that isn't an exact match, and even then some of the exact matches might be misspellings that happen to match another hospital's name (eg, 'Saint Mary's Hospital' vs 'Saint May's Hospital'). That's why the preferred approach would usually be to identify the hospital by an ID number and the name, rather than just the name.

Getting stocks by industry via Yahoo Finance

i want to list all available industries ( like: http://biz.yahoo.com/p/ ) and show all corresponding stocks.
Until now I'm using YAHOO.Finance.SymbolSuggest.ssCallback for the symbol suggestion and http://finance.yahoo.com/d/quotes.csv?s=... for getting the stock's data.
Does anyone have any idea how to get all industries and corresponding stocks?
Is there another hidden Yahoo API?
Lists of all available industries are called GICS Sectors for Standard and Poor's (S&P500 will use that) and ICB for Dow Jones and FTSE. Hence it used by Nasdaq, Nyse and others markets.
It seems like Yahoo uses a third industry classification by Morning Star, but since I'm not quite sure I will give both ways of retrieving data.
Morning Star
I don't know if Yahoo really sticks to this classification, but some names were really close so let's see it:
You need to go to their Index Data and in each sector, click on it and then at the bottom View complete index holdings.
It's not as precise as in Yahoo industry list, but it's all you can do with Morning Star. Not very convincing, I know...
GICS Sectors
GICS Sectors are now a trademark of Standard and Poor's and then data have to be sought for in S&P's website.
Short answer: take a look at this page, you will need to be registered (it's free and easy) and you can download spreadsheets (xls) with stocks and corresponding sectors. Nevertheless, things aren't always easy, and you will have to do a bit of a search to retrieve all stocks with their corresponding industries. For example, the file INDICATED_RATE_CHANGE.xls will give you some companies and their sectors in each month of 2012. Using that and SP500_DividendAristocrats_2012.xls you should be able to retrieve at least a large part of S&P 500 companies.
ICB
ICB is used by NYSE, NASDAQ etc... Then it's a lot simpler than S&P and MorningStar. Here is your answer. BOOM! Direct link!
Link is dead :(
Finally
I strongly advise you to use the simpler and most-used industry classification index: the ICB. It will always be available and publicly displayed since millions of investors relay everyday on it, without having to use S&P financial services or MorningStar brokerage services...
EDIT
You can look at nasdaq.com to retrieve all companies and their corresponding sector: here for Nasdaq and here for Nyse
Get all industry-IDs from here:
http://biz.yahoo.com/ic/ind_index.html
(look at the links)
Then use YQL ( https://developer.yahoo.com/yql/console/ )
with a query like this:
select * from yahoo.finance.industry where id=912