This algo is an implementation of Universal Portfolios, described in paper by Professor Thomas M. Cover from Stanford. His book is one of the standard textbooks in Information Theory. For implementation tricks to bring the theory into practice, please refer to comments in the code.
This model makes no statistical assumption about distribution of asset prices (e.g. normal, log-normal). Also, it leaves few rooms for backtest-fitting, as only parameters are choice of (i) assets in portfolio and (ii) look back period. I chose very basic 8 ETFs and one year period.
Interestingly, in late 2008 the model decided to own none of the 8 ETFs and just held cash during financial crisis. Even more interestingly, the model again sold all ETFs on August 26, 2015, so we just have $3M in cash today (started with $1M 10 years ago)...
Note: It is long-only and with high beta - not suitable as for contest. But it could be potentially a useful framework in allocating funds to algos in hedge fund.