%% Bollinger Chart
% The bolling function in Financial Toolbox™ software produces a Bollinger band chart using all the closing prices in an 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. First, load the data using the ibm.dat data file and then execute the bolling function to plot the Bollinger bands.

load ibm.dat;
[ro, co] = size(ibm);
bolling(ibm(:,4), 15, 0);     

axis([0 ro min(ibm(:,4)) max(ibm(:,4))]);
ylabel('Price ($)');
title(['International Business Machines']);
dateaxis('x', 6,'31-Dec-1994')

% Specify the axes, labels, and titles. Use dateaxis to add the x-axis dates.
% For help using MATLAB® plotting functions, see Create 2-D Graph and Customize Lines in the MATLAB documentation. See the MATLAB documentation for details on the axis, title, xlabel, and ylabel functions.
% Copyright 2015 The MathWorks, Inc.