Exercise

Refine constraints and objectives

Here we hypothesize that refining constraints and/or objectives will improve performance. Let us add a risk budget objective to set a minimum and maximum percentage contribution to risk for each asset. We will be building on the portfolio specification we created. This is a more complex optimization problem and will require a global solver so we will use random portfolios as the optimization method.

Instructions

100 XP
  • Add a risk budget objective risk_budget to port_spec where risk is defined as standard deviation. Set the minimum percentage risk to 5% and the maximum percentage risk to 10%.
  • Run the optimization with quarterly rebalancing. Set the training period and rolling window to use 5 years of data. Assign the results to a variable named opt_rebal_rb.
  • Chart the weights.
  • Chart the component percentage contribution to risk.
  • Compute the portfolio returns using Return.portfolio(). Assign the returns to a variable named returns_rb.