clear;
clc;

[~, ~, raw] = xlsread("y9999.xlsx")
raw = raw(3 : end, [1, 5, 6]);

dates = datetime(raw(2 : end, 1), "InputFormat", "yyyy/MM/dd");
prices = [raw{2 : end, 2}];
plot(dates, prices);
xlabel("Year");
ylabel("台灣加權指數");
grid on;

return_rates = diff(prices) ./ prices(1 : end - 1);
mask = return_rates < -0.05;
dates(mask)