File Exchange

image thumbnail

View and add transaction to portfolios on Google Finance

version 1.2.0.0 (5.79 KB) by pangyuteng
View and add transactions to portfolios on Google Finance. A Google account will be required.

1 Download

Updated 03 Sep 2011

View Version History

View License

Attached are two very simple functions demonstrating how you can view and add transactions to portfolios on Google Finance from Matlab.

Update: I can only get these functions to work on Matlab 2008b 32-bit version, the 64-bit version does not work on my PC.

Cite As

pangyuteng (2020). View and add transaction to portfolios on Google Finance (https://www.mathworks.com/matlabcentral/fileexchange/32167-view-and-add-transaction-to-portfolios-on-google-finance), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

pangyuteng

Hello. *** per many of you noted below, the old API to grab data from yahoo is no longer live ***
I have stopped maintaining the code at file exchange for a few years now, and have transitioned to Python. For those interested in moving to python (python is free, and the community is huge, its great for many things including quantitative finance and data analysis), checkout these free libraries: numpy, pandas, matplotlib, quandl, yfinance; for back-testing,live-testing platforms, checkout Quantconnect (commercial) and Zipline (used to be maintained by Quantopian, which their platform will soon be closed from public use).
I have provided below an example python jupyter notebook to get price and other info from yahoo:
https://github.com/pangyuteng/aigonewrong/blob/main/finance/basics/price-return.ipynb
You will just need to install Git and Docker which are all free. Steps to build the container and launch the notebook is provided here:
https://github.com/pangyuteng/aigonewrong/blob/main/finance/basics/README.md
yfinance site:
https://github.com/ranaroussi/yfinance
more data here (historical daily/monthly equity price, index, rates) with python api.
https://www.quandl.com/
and here daily/minute price, i believe they have bid ask price also, and historical option data! you'll need to use their jupyter notebook online.
https://www.quantconnect.com
https://www.quantconnect.com/forum/discussion/7882/front-month-implied-volatility

if you have basic docker,python issue, you will just have to google or search in stackoverflow!

pangyuteng

Hi Emad. Unfortunately, Google no longer offers this service.* See the following link for alternative methods. Please do share your solutions on the FEX! :)
http://stackoverflow.com/questions/16509443/way-to-access-users-google-finance-portfolio

*https://developers.google.com/finance/

Emad Hasan

Hi, Does this code still work? I just tried it on a 32-bit 2013b but did not work. Got the following error.

Java exception occurred:
java.io.IOException: Server returned HTTP response code: 403 for URL: http://finance.google.com/finance/feeds/default/portfolios/10/positions/NASDAQ:GOOG/transactions/

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

from line: 73

DMITRI

I am trying googlePortfolioHoldingsExample and getting Java exception:

Java exception occurred:
java.io.IOException: Server returned HTTP response code: 403 for URL: http://finance.google.com/finance/feeds/default/portfolios/42/positions/NASDAQ:GOOG/transactions/

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

from line: 73

Is this API still working?

pangyuteng

glad you liked it! thanks for the 5 star rating. :)

Mirko

Ted, again a smart idea.

pangyuteng

Please note that this function will not work on the 64-bit version of Matlab.

pangyuteng

I got that error in my other computer too.
http://www.mathworks.de/matlabcentral/newsreader/view_thread/290639
The above link may provide a solution to our encountered error.

Emad Hasan

Great Idea, but I am getting the following error. Please advise.

??? Error using ==> connectAndAuthorize at 49
Java exception occurred:
java.io.IOException: The issuer can not be found in the trusted CA list.

at ice.ssl.SSLSocket.processEvent(OEAB)

at ice.ssl.SSLSocket.certCallback(OEAB)

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!