In this example project, we use Math.NET Numerics library to optimize a fictitious 4-stock portfolio with known mean returns, standard deviations and correlation matrix.
In order to compute the optimal weights for a given target return and risk-free rate, we use linear algebra operations made possible with Numerics Linear Algebra module.
Alexandre Catarino
Now with the right backtest! :)
Alexandre Catarino
In this version, we are using real data and Math.NET Numerics Statistics to compute correlation coefficient.
Jared Broad
I looked up each one individually, IBM tanked that period -- but the rest did well. Why do you think the whole portfolio did so poorly? Perhaps there's a bug in the weighting? That last share performed worse than any of the individual constituents... Even IBM tanking was only -20%
What happens when you rebalance each month?
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Alexandre Catarino
Denitely, it did poorly because of the stock picking method (there was none, I just used some of the available symbols at GitHub/Lean/Data). I am pretty confident there is no bug in the weighting, since I checked it against a theorical exercise.
We could use this algorithm is two different ways:
I will be go after #2, using Meb Faber GTAA stock piking method.
Alexandre Catarino
In this implementation, we use Meb Faber GTAA assets and rebalance monthly with weights that are recalculated monthly. Like Faber, we use a lookback period of 200 trading days.
The strategy is now profitable, but cannot beat the benchmark.
Bryan Fletcher | FXCM
Alexandre,
Very interesting stuff. Thanks for sharing.
What if, instead of starting with a fixed list of instruments, you use a similar approach to select the instruments for your algorithm from a larger universe of instruments?
I've been thinking a lot about the different ways to implement a similar approach, but one that uses dynamic filtering to select and modify the current portfolio based on strength, correlation of instruments and volatility of instruments and portfolio. In effect you would have a fixed 'parking lot' of X instruments from a possible universe of Y instruments.
In theory this type of approach sounds appealing to me, but there are a lot of moving parts. Here's a brief summary of my thinking on some different ways to approach to this. I would be curious to hear your and the community's thoughts on implementing similar approaches.
Risk Management
Correlation
Volatility
Dynamic Portfolio Selection
Ranking
·
Alexandre Catarino
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!