I am trying to implement the Universal Portfolio algorithm strategy inspired by the paper by Professor Cover from Stanford.

At the moment I am trying to understand the underlying logic of the algorithm. My goal is to implement the algorithm using 8 ETFs (classified into 3 categories: Equities, Fixed Income and Commodities), to represent the "market".

My understanding is that the strategy, based on historical returns, evaluates every possible portfolio with every possible combination of weights and calculates the return of each.

Then the universal portfolio is the portfolio that is the weighted average of all these possible portfolios, weighted by their performance.

To implement this, here is a summary of my steps:

  • Gather 1-year worth (252 trading days) worth of historical prices
  • Calculate percentage returns
  • At this stage, I would compute the integral of wealth across all portfolios to generate the weight

At this stage, I am a bit lost - How would I derive the weights for each asset for rebalancing the portfolio?

Is there any statight forward shortcut to compute the weights? (For reference, I am planning on implementing this in Python

Thanks :)

Paper for reference:

  • $\begingroup$ Interesting question. Another, related, question is "how much data do you need". I suspect (though I have never seen it discussed) that 1 year is far too little. $\endgroup$ – Alex C Apr 1 '18 at 22:04
  • $\begingroup$ @AlexC Per my understanding, the algorithm uses the past years data to select the initial asset weights. After that, it periodically rebalanced based on the new price movements. So I think one year's worth of data might be enough for initial set up $\endgroup$ – Guest Apr 1 '18 at 22:10

The weights can be naive or optimized for some metric or your choosing. If your weighting methodology is arbitrary/naive, then one year of data may be sufficient. The example below in the link uses a 40/40/20 weighting of equity/bond/gold respectively.

However, if you are optimizing for something (Omega, Sortino, Sharpe or any other metric) you probably want to come to the weighting conclusion using far more than one year of data--as hinted at by @AlexC in the comments.

The link below should help out with the Python implementation. The code is not mine and I have not tested the code at all but it is well marked-up, and there is some useful info in the comments below it.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.