QuantConnect / Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
https://lean.io
Apache License 2.0
9.74k stars 3.26k forks source link

Implements C# version of BlackLittermanPortfolioConstructionModel #1998

Closed jaredbroad closed 6 years ago

jaredbroad commented 6 years ago

Expected Behavior

C# and Python implementations of all models.

Actual Behavior

Missing Black Litterman implementation in C#.

Potential Solution

Port to C#: https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/BlackLittermanPortfolioConstructionModel.py

Checklist

AlexCatarino commented 6 years ago

We have tried to port the python version of BlackLittermanPortfolioConstructionModel into C# using MathNet and Accord: BlackLittermanPortfolioConstructionModel.cs.

However, to our knowledge, neither of these libraries can find the minimum of a function given:

The function we want to minimize is the Sharpe Ratio, the initial guess if the equally weighted portfolio, the boundary conditions is that weights of each security must be between -1 and 1 and the internal constraint is that the sum of weights must be 1.

The solution of this problem might be applicable to #2219.

AlexCatarino commented 6 years ago

@TheLastTech, yes: Implements C# version of BlackLittermanPortfolioConstructionModel. Good luck!

wildart commented 6 years ago

Unfortunately, without a proper nonlinear optimizer, it will be hard to get it work correctly.

jaredbroad commented 6 years ago

We have http://www.alglib.net/optimization package available in QC Cloud. Can assume safe to use here.