MATLAB Answers

Datafeed Toolbox does not work with Yahoo

14 views (last 30 days)
I am trying to connect to Yahoo Finance with the Datafeed Toolbox, but I obtain the following error:
>> c = yahoo
Error using yahoo
Unable to connect or retrieve data from given URL.
>> fetch(yConnect,’AAPL’) % generates an error
>> fetch(yahoo,'%5EGSPC',{'Last'}) % either returns empty or generates an error
Error using urlreadwrite (line 98)
Error downloading URL. Your network connection may be down or your proxy settings improperly configured.
Error in urlread (line 36)
[s,status] = urlreadwrite(mfilename,catchErrors,url,varargin{:});
Error in yahoo/fetch>wwwread (line 407)
retdat = urlread(fetchurl);
Error in yahoo/fetch (line 222)
tmpdat = wwwread(fetchurl,numinputs);
>> fetch(yahoo,'%5EGSPC',{'close'}, today - 30,today-1)
Error using yahoo/fetch (line 387)
Unable to return historical data for given security.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Aug 2017
Edited: MathWorks Support Team on 7 Aug 2017
For more information, please see the following bug report:


Paul Shoemaker
Paul Shoemaker on 21 May 2017
For those who have active accounts with TD Ameritrade / Thinkorswim, I have a solution to this problem. This involves use of a Matlab toolbox I developed so it can be considered a solicitation. Therefore, if you want to know more then just send me an email and we can discuss through other channels.
Victor Hatman
Victor Hatman on 23 May 2017
I implemented the fix (I am using R2017a), and it does not work for historical data. It only works for current data:
>> fetch(yahoo,'IBM')
ans =
struct with fields:
Symbol: {'IBM'}
Last: 152.6400
Date: 736837
Time: 0.6681
Change: 0.6600
Open: 152.1000
High: 152.8400
Low: 151.6000
Volume: 3302539
But when I try for historical data I get an error:
>> fetch(yahoo,'IBM','02/01/2017','03/20/2017')
Error using yahoo/fetch (line 387)
Unable to return historical data for given security.
Octavio Garcia
Octavio Garcia on 23 May 2017
I hope your fix work and can be shared to the community in the File Exchange. Not historical but is something

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!