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

[IMPROVE] SDK - Portfolio process is undesirable and could be improved #3364

Closed
JerBouma opened this issue Nov 10, 2022 · 2 comments
Closed
Assignees
Labels
portfolio Portfolio menu

Comments

@JerBouma
Copy link
Contributor

Needing to go through the following steps to use the portfolio functionalities is confusing. It needs to follow the structure we have in place for the rest of the OpenBB SDK (e.g. use openbb.portfolio.load or openbb.portfolio.po.load)

from openbb_terminal.sdk import Portfolio

# Define your own orderbook location here
orderbook_path = "/Users/jeroenbouma/OpenBBUserData/portfolio/holdings/Public_Equity_Orderbook.xlsx" 

# Load in the transactions
transactions = Portfolio.read_orderbook(orderbook_path)
P = Portfolio(transactions)
P.generate_portfolio_data()

# Load in the benchmark, by default this is the SPY ETF
P.load_benchmark()

Same applies to portfolio optimisation:

import pandas as pd

order_book_path = "/Users/jeroenbouma/OpenBBUserData/portfolio/allocation/SP_500_Portfolio.xlsx"
order_book = pd.read_excel(order_book_path)
order_book_cols = ['Ticker', 'Asset Class', 'Sector', 'Industry', 'Country',
       'Current Invested Amount', 'Currency']

order_book = order_book[order_book_cols]
@github-actions github-actions bot added the portfolio Portfolio menu label Nov 10, 2022
@montezdesousa
Copy link
Contributor

montezdesousa commented Nov 11, 2022

@Chavithra suggested a solution that we can make it available for users as an endpoint, will address this here #3393

@montezdesousa
Copy link
Contributor

I'll close this one since pr #3401 is merged. Feel free to reopen if not ok

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

No branches or pull requests

2 participants