Skip to content

Commit

Permalink
chore: catch en error in EF
Browse files Browse the repository at this point in the history
  • Loading branch information
chilango74 committed Dec 29, 2023
1 parent 83d185e commit b73342c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import matplotlib.pyplot as plt
import okama as ok

indexes = ["RGBITR.INDX", "MCFTR.INDX", "GC.COMM"]
ef = ok.EfficientFrontier(indexes, ccy="RUB", full_frontier=True, inflation=False, n_points=50)
ef.plot_cml(rf_return=0.15, y_axe="cagr")
plt.show()
indexes = ["RGBITR.INDX", "RUCBTRNS.INDX", "MCFTR.INDX", "GC.COMM"]
bounds = [(0, 0.7), (0, 0.7), (0, 1), (0, 0.19)]
ef = ok.EfficientFrontier(indexes, ccy="RUB", full_frontier=False, bounds=bounds, inflation=False)
print(ef.get_tangency_portfolio(rf_return=0.08))
## TODO: replace ValueError: Weights sum is not equal to one. with custom error mesage

pf = ok.Portfolio(["SPY.US", "BND.US"], weights=[.5, .5], rebalancing_period="month")
pf.wealth_index_with_assets.plot()
plt.show()

0 comments on commit b73342c

Please sign in to comment.