No BSD License  

Highlights from
Using MATLAB to Develop Portfolio Optimization Models

image thumbnail

Using MATLAB to Develop Portfolio Optimization Models

by

 

29 Sep 2005 (Updated )

Scripts to create time-evolving efficient frontiers and to backtest results.

maxdrawdown(Data)
function MaxDD = maxdrawdown(Data)
%MAXDRAWDOWN Calculate maximum drawdown for one or more total return price series

[T, N] = size(Data);

MaxDD = zeros(1,N);

for i = (T - 1):-1:1
	for j = 1:N
		DD(j) = (min(Data(i:T,j)) - Data(i,j))/Data(i,j);
	end
	p = find(DD < MaxDD);
	MaxDD(p) = DD(p);
end

Contact us