Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom weighting not working #39

Closed
NelsonMaty opened this issue Aug 15, 2021 · 3 comments
Closed

Custom weighting not working #39

NelsonMaty opened this issue Aug 15, 2021 · 3 comments

Comments

@NelsonMaty
Copy link

Describe the bug
Asset allocation is equally weighted when no optimisation method is provided.

To Reproduce
Use the documented example for custom asset allocation.

portfolio = Engine(
      start_date = "2018-01-01",
      portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"], 
      weights = [0.1, 0.3, 0.15, 0.25, 0.2], #custom weights
)

Expected behavior
portfolio.weights equals to [0.1, 0.3, 0.15, 0.25, 0.2]

Actual behavior
portfolio.weights equals to [0.2, 0.2, 0.2, 0.2, 0.2]

@NelsonMaty
Copy link
Author

I believe this issue was introduced on this PR: #35

@ssantoshp
Copy link
Owner

ssantoshp commented Aug 16, 2021

Hi ✋

Thanks for reporting this issue. I just fixed it, it should be fine now. It has been corrected in the 1.9.8 version of Empyrial :)

You can check it here: https://colab.research.google.com/drive/1dygKh3LsmBEtevSXLCG2h_8bvpSACbYt?usp=sharing

@NelsonMaty
Copy link
Author

It's working perfectly, thanks!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants