Financial Toolbox | ![]() ![]() |
Bollinger Chart Example
Next the Financial Toolbox bolling
function produces a Bollinger band chart using all the closing prices in the same IBM stock price matrix. A Bollinger band chart plots actual data along with three other bands of data. The upper band is two standard deviations above a moving average; the lower band is two standard deviations below that moving average; and the middle band is the moving average itself. This example uses a 15-day moving average.
Assuming the previous IBM data is still loaded, simply execute the Financial Toolbox function.
Specify the axes, labels, and titles. Again, use dateaxis
to add the x-axis dates.
axis([0 ro min(ibm(:,4)) max(ibm(:,4))]); ylabel('Price ($)'); title(['International Business Machines']); dateaxis('x', 6,'31-Dec-1994')
For help using MATLAB plotting functions, see Creating Plots" in the MATLAB documentation. See the MATLAB documentation for details on the axis
, title
, xlabel
, and ylabel
functions.
![]() | High-Low-Close Chart Example | Analyzing and Computing Cash Flows | ![]() |