필터 지우기
필터 지우기

How plot MOVING AVERAGE?

조회 수: 3 (최근 30일)
Maty
Maty 2014년 1월 21일
댓글: Maty 2014년 1월 22일
Hi guys! I need your help!
I'm trying to plot a moving average by taking the file from "Yahoo Finance" I've already seen the function "tsmovavg" but that doesn't helped me.
From MATLAB help I've seen the following example about the different types of MA:
load disney.mat
weekly = toweekly(dis);
dates = (weekly.dates);
price = fts2mat(weekly.CLOSE);
window_size = 12;
simple = tsmovavg(price,'s',window_size,1);
exp = tsmovavg(price,'e',window_size,1);
tri = tsmovavg(price,'t',window_size,1);
semi_gaussian = [0.026 0.045 0.071 0.1 0.12 0.138];
semi_gaussian = [semi_gaussian fliplr(semi_gaussian)];
weighted = tsmovavg(price,'w',semi_gaussian,1);
modif = tsmovavg(price,'m',window_size,1);
plot(dates,price,...
dates,simple,...
dates,exp,...
dates,tri,...
dates,weighted,...
dates,modif)
datetick
legend('Stock Price','Simple','Exponential','Triangular','Weighted',...
'Modified','Location','NorthWest')
title('Disney Weekly Price & Moving Averages')
However I have some problems about setting the problem
Thanks for your consideration and any help!!!
Maty
  댓글 수: 2
Image Analyst
Image Analyst 2014년 1월 21일
Maty
Maty 2014년 1월 22일
I want take a time series from Yahoo finance and then draw the moving average (for example for 20 lags) of this time series.
Thanks

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by