Price and Volume chart
The syntax for
priceandvol has changed. Previously, when using
table input, the first column of dates could be a datetime array, date character
vectors, or serial date numbers, and you were required to have specific number of
When using table input, the new syntax for
No need for time information. If you want to pass in date information, use timetable input.
No requirement of specific number of columns. However, you must provide valid column names.
linebreakmust contain columns named
Generate a Price and Volume Chart for a Data Series for a Stock
Load the file
SimulatedStock.mat, which provides a timetable (
TMW) for financial data for TMW stock. This price and volume chart for the TMW stock contains the open, high, low, close, and volume for the most recent 21 days.
load SimulatedStock.mat priceandvol(TMW(end-20:end,:));
Data — Data for opening, high, low, closing prices, and volume traded
matrix | table | timetable
Data for opening, high, low, closing prices, and volume traded, specified
as a matrix, table, or timetable. For matrix input,
5 matrix of opening, high,
low, closing prices and traded volume. Timetables and tables with
M rows must contain variables named
'Volume' (case insensitive).
h — Graphic handle of the figure
Graphic handle of the figure, returned as a handle object.
Version HistoryIntroduced in R2008a
R2022b: Support for negative price data
Data input accepts negative prices.