Code covered by the BSD License  

Highlights from
Real-Time Stock Viewer

image thumbnail

Real-Time Stock Viewer

by

 

25 Aug 2004 (Updated )

Plot and analyze live market data from Bloomberg or Yahoo.

Editor's Notes:

This file was a File Exchange Pick of the Week

defineyahootimer.m
% Script to define a timer object that reads and plot live market data
% from Yahoo automatically.  TimerFcn is YAHOORT.m.
%
% To start the process, type the following at the command prompt:
%
%   >> defineyahootimer,start(t)
% 
% To stop the process, type the following at the command prompt:
%   >> stop(t),delete(t)
% 
% Author:
% Brian Kiernan
% The MathWorks
% August 27, 2004

% open Yahoo connection
Conn = yahoo;

% Define ticker symbol of the Price you want returned
ticker = 'IBM';
period = 5;

% % Real Time operation
t = timer('TimerFcn',{@yahooRT, Conn, ticker},'ExecutionMode', ...
    'fixedRate', 'Period', period,'StopFcn','close(Conn)');

Contact us