santoshlite / Empyrial

An Open Source Portfolio Backtesting Engine for Everyone | 面向所有人的开源投资组合回测引擎
https://empyrial.gitbook.io/empyrial/
MIT License
914 stars 124 forks source link

assets value / non-stock based portfolio? #74

Closed andrew521 closed 1 year ago

andrew521 commented 1 year ago

Wondering if Empyrial can be used with a non-stock based portfolio. The example in the docs is like this:

from empyrial import empyrial, Engine portfolio = Engine(
start_date= "2018-06-09", portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"], weights = [0.2, 0.2, 0.2, 0.2, 0.2], #equal weighting is set by default benchmark = ["SPY"] #SPY is set by default ) empyrial(portfolio)

Is there any alternate way to define a portfolio, not as a list of stocks / weights but based on the value of the assets in the account?

santoshlite commented 1 year ago

Hi, sorry for the late reply! I get what you mean. You cannot do that for now, however, I am working on adding this feature which would allow the user to feed the Engine with returns data from your portfolio.

jo520iverson commented 1 year ago

Hi, sorry for the late reply! I get what you mean. You cannot do that for now, however, I am working on adding this feature which would allow the user to feed the Engine with returns data from your portfolio.

It would be great if we can feed return data of our portfolio as well as bechmark.

wiener30 commented 1 year ago

It is a must-feature. Different data sources could be used.

santoshlite commented 1 year ago

Definitely, will work on that this summer! Thanks for the feedback