%% Generate a Kagi 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 Kagi chart is for closing prices of the stock TMW for the 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';
kagi(TMW(end-20:end,:))
title('Kagi Chart for TMW')

% Copyright 2012 The MathWorks, Inc.