Filter löschen
Filter löschen

how to backtest trading strategy???

1 Ansicht (letzte 30 Tage)
Josh Perry
Josh Perry am 18 Jul. 2015
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

Antworten (0)

Kategorien

Mehr zu Financial Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by