Code covered by the BSD License  

Highlights from
Real-Time Datafeed from Yahoo!

Real-Time Datafeed from Yahoo!

by

 

30 Jun 2008 (Updated )

Extension of Datafeed Toolbox's Yahoo object, allowing real-time data to be fetched

yahooRTdemo.m
%YAHOORTDEMO verifies that YAHOORT is returning real-time data by comparing the
%timestamp on data returned by YAHOO vs. YAHOORT.
%
% NOTE: There's only a difference during active trading hours! (9:30am-4pm ET)
%
% For instructions on YAHOORT, type
%     help yahooRT
% at the MATLAB command prompt.


% Must set to a valid Yahoo account subscribed to Yahoo Premium Finance.
username = '';
password = '';

y = yahoo;
r = yahooRT(username,password);

% FETCH delayed Yahoo data
dataY = fetch(y,'GM')
timeY = dataY.Date+dataY.Time;
datestr(timeY)

fprintf('\n');

% FETCH real-time Yahoo data
dataR = fetch(r,'GM')
timeR = dataR.Date+dataR.Time;
datestr(timeR)

fprintf('\n');

% Show the difference between the timestamps
fprintf('Difference between times: %s\n', datestr(timeR-timeY,'HH:MM:SS'));

Contact us