0

I create optimal portfolio using optimize.portfolio and solver DEoptim (maxDrawdown risk objective with target -0.1 and maximum return objective). But when I plot the optimized portfolio object, it does not seem that this portfolio is optimal as there are portfolios with the same Drawdown and better returns. Could someone explain?

library('PortfolioAnalytics')
library('PerformanceAnalytics')
library('DEoptim')

data(edhec)
ret <- edhec[, 1:10]

init.portf <- portfolio.spec(assets=colnames(ret))
init.portf <- add.constraint(portfolio=init.portf, type="full_investment")
init.portf <- add.constraint(portfolio=init.portf, type="long_only")

group_list <- list(group1=c(3),
                   group2=c(1, 2),
                   group3=c(5, 7, 8))

init.portf <- add.constraint(portfolio= init.portf, 
                             type="group", 
                             groups=group_list,
                             group_min=c(0.03, 0, 0),
                             group_max=c(0.032, 0.2, 0.3))


ret.obj.portf <- add.objective(portfolio=init.portf, type="return", 
                               name="mean")


ret.obj.portf <- add.objective(portfolio = ret.obj.portf,
                               type = 'risk',
                               name = 'maxDrawdown',
                               arguments = list(inverse=TRUE),
                               target = -0.1)


ret.obj.portf$constraints[[1]]$min_sum <- 0.99
ret.obj.portf$constraints[[1]]$max_sum <- 1.01
ret.obj.portf


set.seed(123)
opt.obj.no1.1 <- optimize.portfolio(R=ret, portfolio=ret.obj.portf,
                                    optimize_method="DEoptim", search_size=2000, trace=TRUE)
opt.obj.no1.1


chart.RiskReward(opt.obj.no1.1, 
                 main = 'Optimized Portfolio: max return and 10% maxDD, all investments allowed',
                 return.col = "mean", risk.col = 'maxDrawdown')

kobriukee
  • 1
  • 1
  • Welcome to SO. Please include a reproducible question as suggested here [How to ask good question](https://stackoverflow.com/help/minimal-reproducible-example) & [Reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) include your data (as a dataframe object or use dput("data"), the code you have tried and your expected output. This will make it more likely to get a good answer.Please do not post an image of code/data/errors: it cannot be copied or searched (SEO), it breaks screen-readers, and it may not fit well on some mobile devices. – rj-nirbhay May 30 '20 at 16:43
  • Thank you. I have added the code. However, I can't add the actual data, therefore, I used edhec dataset as example. Here is a more difficult to see the problem which I experience, but I will try also explain. If you run the code above, you will get risk-reward chart. There optimal portfolio is plotted, but you could see that there are better portfolios (same drawdown, but better returns). However, those portfolios are not returned as optimal. Could you explain why please? – kobriukee May 31 '20 at 09:48

0 Answers0