%% Compare the Relative Price Performance of Stocks
% This example compares the relative price performance of the NASDAQ and the NYSE indexes.
% Load the equity index data.

load Data_EquityIdx

%
% Convert the returns back to prices, specifying the same starting price, 100, for each series, and plot the results.

figure;
plot(ret2price(price2ret([DataTable.NASDAQ DataTable.NYSE]), 100))
ylabel('Prices')
legend('Nasdaq', 'NYSE','Location','Best')
axis tight

% The blue (upper) plot shows the NASDAQ price series. The green (lower) plot shows the NYSE price series.
% Copyright 2015 The MathWorks, Inc.