Load the file SimulatedStock.mat, which provides a timetable (TMW) for financial data for TMW stock. This example shows how to plot asset date, price, and volume on a single axis, given asset TMW containing asset price and volume in most recent 21 days. Note that the variable name of asset price is be renamed to 'Price' (case insensitive).
load SimulatedStock.mat;
TMW.Properties.VariableNames{'Close'} = 'Price';
volarea(TMW(end-20:end,:))
title('Price and Volume Chart for TMW')
Data for prices and traded volume, specified as a matrix, table, or
timetable. For matrix input, Data is an
M-by-2 matrix of prices and traded
volume. Timetables and tables with M rows must contain
variables named 'Price' and 'Volume'
(case insensitive).
Data Types: double | table | timetable
(Optional) Valid axis object, specified as an axes object. The volarea
plot is created in the axes specified by ax instead of in
the current axes (ax = gca). The option
ax can precede any of the input argument
combinations.
A price and volume chart is a graphical
representation used in financial markets to display the price movements of a
security (such as a stock, commodity, or currency) alongside the volume of trades
that occur over a specific period.
volarea accepts Data input as a matrix,
timetable, or table.
The syntax for volarea 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
columns.
When using table input, the new syntax for volarea supports:
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. volarea must contain a
column named ‘price’ (case insensitive).
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.