-
Notifications
You must be signed in to change notification settings - Fork 5
/
example_run.m
28 lines (21 loc) · 928 Bytes
/
example_run.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
script_path = 'portfolio_sortino_ratio'; % insert path to folder 'portfolio_sortino_ratio'
addpath(script_path)
csv_dir = fullfile(script_path,'sample_portfolio');
% [Sortino ratio, Sharpe ratio, total return, Downside Risk, SD, Drawdown]
outcomeWeights = [1,0,1,.09,0,1.5];
nRandom = 1000;
minWeight = .05; maxWeight = 1; limitTickers = 10;
plotScatter = true; plotCorrs = true;
useParallel = false;
% Run optimization:
results = portfolio_sortino_ratio(csv_dir, 'nRandom', nRandom, ...
'outcomeWeights', outcomeWeights, 'minWeight', minWeight, ...
'maxWeight', maxWeight,'limitTickers', limitTickers, ...
'plotScatter', plotScatter, 'plotCorrs', plotCorrs,'parallel',useParallel) %#ok
% View optimized weights:
results.weights
% View average stats across years:
results.stats
% View returns for optimized portfolio compared to individual assets across
% years:
results.returns