필터 지우기
필터 지우기

how to backtest trading strategy???

조회 수: 1 (최근 30일)
Josh Perry
Josh Perry 2015년 7월 18일
Suppose I have a very simple m file such as:
if true
% code
c=yahoo; d = fetch(c,'xom','Close',now-300,now-1,'d');
fetch(c,'xom','Close',now,now-1,'d');
sd=std(d(:,2));
ma = tsmovavg(d(:,2),'s',90,1);
price = w(1,2);
price
if price<ma-2*sd;
outcome='long';
elseif price>ma+2*sd;
outcome='short';
else outcome='exit';
outcome
close(c)
end
which is obviously messed up. How to I backtest such a trading strategy? Can I do something like this using only matlab or do I have to use MT4 or bloomberg or ...? I need help with this VERY BADLY. 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