File Exchange

image thumbnail

get Intraday Stock Price

version 1.1.0.1 (4.02 KB) by pangyuteng
function getHistoricalIntraDayStockPrice obtains intraday stock price from Google.

14 Downloads

Updated 24 Oct 2018

View License

*** looks like GOOGLE shut down the API ***
search stackover flow for more info and alternatives.
https://stackoverflow.com/questions/46070126/google-finance-json-stock-quote-stopped-working
https://stackoverflow.com/questions/51658401/google-finance-api-address-has-changed

For the adventurous folks, I recommend giving Quantopian (python) or Quantconnect (python, c#) a try. Both platforms provide free intraday data as long as you are doing analysis/trading within their platform. I have had success with Quantopian, however they no longer provide live trading via Interactive Broker. Nevertheless, it still is a great platform for doing research given the data available within the platform. For folks considering live trading, you may have better luck with Quantconnect (I have never tried it though). Good luck!
--

function getHistoricalIntraDayStockPrice obtains intraday stock price from Google given the symbol of stock and the name of market which the stock is listed under. The accompanying file demonstrates one method for "cleaning" the data prior analysis.

Cite As

pangyuteng (2019). get Intraday Stock Price (https://www.mathworks.com/matlabcentral/fileexchange/32745-get-intraday-stock-price), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

Sandy Ng

Great script Ted. But it seems the URL to download intraday data from google finance is not working anymore. Anyway to work around this?

Any idea how can I retrieve stock's market cap? or # shares outstanding? THX

David Vidal

Google has changed its URL, if someone is using this script you have to change: www.google.com.... by finance.google.com....
http://www.traderji.com/community/threads/google-finance-intraday-data-not-getting-downloaded.105319/page-2

David Vidal

Nothing, it is ok now, sorry for the comment. It works perfectly.

David Vidal

I do not know if it is only my case. But it does not wor any longer (nor with examples):

Struct contents reference from a non-struct array object.

Error in getHistoricalIntraDayStockPrice (line 80)
data.close = importDataStruct.data(:,1);

Interesting discussion! I also wonder if it is possible to get historical option data from Google or Yahoo. I am looking for years of data back?
I found Intradata.co but they only offer stocks and forex.

pangyuteng

@ Jonathan, you can get the output and then filter by day.
@Jay, the number of outstanding shares can be found here: http://finance.yahoo.com/q/ks?s=MSFT+Key+Statistics

Jonathan

Is there a way to use this to get a specific day's data? For example, I want to 1-min bars for GOOG on Feb 18th, 2015.

Jay Cheng

Besides the H L C O of a stock, can you also download the number of outstanding shares?

pangyuteng

That is a great idea/question Taylor. I have been searching for free intraday forex data too, but I have not found one yet. Please share your implementation with the community if you do figure out how to get those data!

Taylor Xie

Hi,Teng,I want to know how to download the intraday data of Forex exchange data, for example EURUSD. I want to edit your function, but I don't know the url link to get the Forex exchange rate.

pangyuteng

I have wondered that myself and could not find any documentation for Finviz. Stackoverflow might be a good place to ask this, I did a quick search there, there is not much on Finviz (
http://stackoverflow.com/search?q=finviz )

I'm not sure what kind of data you need, but if it is available on yahoo, you can refer to my other function "get-stock-information-from-yahoo" as a template for downloading data with YQL. Best of luck.

Ryan

Another question Ted...Have you been able to find any actual documentation for finviz.com? I have been looking all over for it but can't find anything anywhere. All I have found is a few random posts where people have used queries similar to the one you have used.

pangyuteng

Thanks Ryan. To my knowledge, there are no publicly accessible historical option data, intraday or daily. But if you do find it, it would be great if you can share it on this file exchange. :)

Ryan

Great Work! By chance, do you know if it's possible to download historical intraday option data from google or yahoo?

Updates

1.1.0.1

updated description to state api has been shut down.

1.1.0.0

updated function cleanUSIntradayStockPrice.m
image source: http://smallivy.files.wordpress.com/2010/05/moneyrunning.jpg

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux