function [SMA, daysSMA] = exam_2_function_1(price, ndaysSMA)

ndays = length(price);
n = (ndaysSMA - 1)/2;
i = 1;
for j = (1+n):ndays-n
    SMA(i) = sum(price(j-n:j+n))/ndaysSMA;
    daysSMA(i) = j;
    i = i + 1;
end