View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Stock Class

5.0 | 1 rating Rate this file 17 Downloads (last 30 days) File Size: 5.18 KB File ID: #29449 Version: 1.6
image thumbnail

Stock Class


Jeffrey Kantor (view profile)


18 Nov 2010 (Updated )

An easy to use class to download, display, and plot stock information from Yahoo finance.

| Watch this File

File Information

Use this simple, self-contained class definition to obtain quotes and historical data from Yahoo finance.
f = stock('f','5y','d);

creates a stock object with a current quote and five year history of daily data for the stock symbol 'f' (Ford Motor Company).


charts the historical data. The default disp(f) method returns current quote information.


Ford Motor Compan (NYSE:F)
Last Trade: 16.28 (4:01pm 11/19/2010)
Daily Change: 0.16 (0.99%)
Prev. Close: 16.12
Day Open: 16.02
Day Range: 15.83 - 16.38
52wk Range: 8.40 - 17.42
P/E 8.53
Dividend Yield N/A

Daily Price History: 21-Nov-2005 to 19-Nov-2010
Volatility: 60.40% (annualized)
Mean Log Return: 14.09% (annualized)

Additional properties and methods provide access to wide range of data for the selected stock. The individual objects may be stored in structure arrays to track investment portfolios.

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.11 (R2010b)
MATLAB Search Path
Other requirements Matlab version 10.6 or higher.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
20 Apr 2011 David Conger

21 Nov 2010 1.2

Added a more informative disp method, and additional properties.

06 Dec 2014 1.6

Update to the new Matlab Toolbox format.

Contact us