Hey,
Trying the basic tutorial using the test prices seems to work fine, but inputting crypto prices leads to errors when calculating the max Sharpe value:
df_merged.head()
| Date |
BTC |
ETH |
LTC |
| 2018-01-01 |
13657.2 |
772.641 |
229.033 |
| 2018-01-02 |
14982.1 |
884.444 |
255.684 |
| 2018-01-03 |
15201 |
962.72 |
245.368 |
| 2018-01-04 |
15599.2 |
980.922 |
241.37 |
| 2018-01-05 |
17429.5 |
997.72 |
249.271 |
mu = expected_returns.mean_historical_return(df_merged)
BTC -0.654099
ETH -1.011251
LTC -1.016013
dtype: float64
S = risk_models.sample_cov(df_merged)
|
BTC |
ETH |
LTC |
| BTC |
0.447307 |
0.467077 |
0.487518 |
| ETH |
0.467077 |
0.756588 |
0.623595 |
| LTC |
0.487518 |
0.623595 |
0.803425 |
ef = EfficientFrontier(mu, S)
raw_weights = ef.max_sharpe()
OptimizationError Traceback (most recent call last)
<ipython-input-96-c11009779024> in <module>()
1 ef = EfficientFrontier(mu, S)
----> 2 raw_weights = ef.max_sharpe()
1 frames
/usr/local/lib/python3.6/dist-packages/pypfopt/base_optimizer.py in _solve_cvxpy_opt_problem(self)
198 raise exceptions.OptimizationError
199 if opt.status != "optimal":
--> 200 raise exceptions.OptimizationError
201 self.weights = self._w.value.round(16) + 0.0 # +0.0 removes signed zero
202
OptimizationError: Please check your objectives/constraints or use a different solver.
Weirdly enough, if I limit the price interval to just a couple of months, max_sharpe works fine, but then min_volatility breaks down with the same error.
Hey,
Trying the basic tutorial using the test prices seems to work fine, but inputting crypto prices leads to errors when calculating the max Sharpe value:
df_merged.head()mu = expected_returns.mean_historical_return(df_merged)S = risk_models.sample_cov(df_merged)Weirdly enough, if I limit the price interval to just a couple of months, max_sharpe works fine, but then min_volatility breaks down with the same error.