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

Incorporate portfolio class into SDK #3401

Merged
merged 35 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d82e3d2
create functions to interact with portfolio
montezdesousa Nov 12, 2022
bcb832f
fix some docstrings
montezdesousa Nov 12, 2022
be86bdd
view docstrings
montezdesousa Nov 12, 2022
1cfe534
make portfolio loading available in sdk
montezdesousa Nov 12, 2022
5763ea6
reorder some methods
montezdesousa Nov 12, 2022
61803a7
fix bug
montezdesousa Nov 12, 2022
4d55b43
update controller
montezdesousa Nov 12, 2022
b2769b1
update website
montezdesousa Nov 12, 2022
e4905b4
remove import
montezdesousa Nov 12, 2022
eef48e7
change input name
montezdesousa Nov 12, 2022
bc87708
regenerate website
montezdesousa Nov 12, 2022
8a3c771
change portfolio arg name
montezdesousa Nov 12, 2022
46a7031
fix metrics bugs
montezdesousa Nov 12, 2022
8fa7cae
fix report
montezdesousa Nov 12, 2022
ebd1ed3
refactor assets alloc
montezdesousa Nov 12, 2022
e25ebb0
refactor assets sectors alloc
montezdesousa Nov 13, 2022
27caf2d
remove unecessary attributes
montezdesousa Nov 13, 2022
43fbe39
refactor allocaasset sector
montezdesousa Nov 13, 2022
eaabc42
reorganize class
montezdesousa Nov 13, 2022
253bb93
first refactor alloc
montezdesousa Nov 13, 2022
f5b287e
refactor portfolio alloc
montezdesousa Nov 13, 2022
cac281a
black
montezdesousa Nov 13, 2022
9b96987
fix alloc bug
montezdesousa Nov 13, 2022
8e41b08
regenerate sdk website
montezdesousa Nov 13, 2022
4064bee
fix alloc bugs
montezdesousa Nov 13, 2022
e6c84f5
Merge branch 'main' into portfolio_sdk
montezdesousa Nov 13, 2022
630568e
forgot this exception
montezdesousa Nov 14, 2022
9b6a741
some refactor on portfolio alloc country region
montezdesousa Nov 14, 2022
0a45a2a
fix some allocation bugs
montezdesousa Nov 14, 2022
f76f17f
Merge branch 'main' into portfolio_sdk
montezdesousa Nov 14, 2022
fb0281c
add examples
montezdesousa Nov 14, 2022
7a4c153
regenerate website
montezdesousa Nov 14, 2022
36b1131
Merge branch 'portfolio_sdk' of github.com:OpenBB-finance/OpenBBTermi…
montezdesousa Nov 14, 2022
cd298b7
Merge branch 'main' into portfolio_sdk
montezdesousa Nov 14, 2022
7602d92
Merge branch 'main' into portfolio_sdk
jmaslek Nov 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ With:
transactions = Portfolio.read_orderbook("../../portfolio/holdings/example.csv")
P = Portfolio(transactions)
P.generate_portfolio_data()
P.load_benchmark()
P.set_benchmark()

# SDK endpoint access
openbb.portfolio.gaintopain(P)
Expand All @@ -695,7 +695,7 @@ With:
<td>

```python
def get_gaintopain_ratio(portfolio: PortfolioModel) -> pd.DataFrame:
def get_gaintopain_ratio(portfolio: PortfolioEngine) -> pd.DataFrame:

"""..."""

Expand Down
46 changes: 26 additions & 20 deletions openbb_terminal/miscellaneous/library/trail_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -295,36 +295,42 @@ forex.oanda.listorders,openbb_terminal.forex.oanda.oanda_model.order_history_req
forex.oanda.orderbook,openbb_terminal.forex.oanda.oanda_model.orderbook_plot_data_request,openbb_terminal.forex.oanda.oanda_view.get_order_book
forex.oanda.pending,openbb_terminal.forex.oanda.oanda_model.pending_orders_request,openbb_terminal.forex.oanda.oanda_view.get_pending_orders
forex.oanda.positionbook,openbb_terminal.forex.oanda.oanda_model.positionbook_plot_data_request,openbb_terminal.forex.oanda.oanda_view.get_position_book
portfolio.load,openbb_terminal.portfolio.portfolio_model.generate_portfolio,
portfolio.show,openbb_terminal.portfolio.portfolio_model.get_transactions,
portfolio.bench,openbb_terminal.portfolio.portfolio_model.set_benchmark,
portfolio.holdv,openbb_terminal.portfolio.portfolio_model.get_holdings_value,openbb_terminal.portfolio.portfolio_view.display_holdings_value
portfolio.holdp,openbb_terminal.portfolio.portfolio_model.get_holdings_percentage,openbb_terminal.portfolio.portfolio_view.display_holdings_percentage
portfolio.yret,openbb_terminal.portfolio.portfolio_model.get_yearly_returns,openbb_terminal.portfolio.portfolio_view.display_yearly_returns
portfolio.mret,openbb_terminal.portfolio.portfolio_model.get_monthly_returns,openbb_terminal.portfolio.portfolio_view.display_monthly_returns
portfolio.yret,openbb_terminal.portfolio.portfolio_model.get_yearly_returns,openbb_terminal.portfolio.portfolio_view.display_yearly_returns
portfolio.dret,openbb_terminal.portfolio.portfolio_model.get_daily_returns,openbb_terminal.portfolio.portfolio_view.display_daily_returns
portfolio.max_drawdown_ratio,openbb_terminal.portfolio.portfolio_model.get_maximum_drawdown,openbb_terminal.portfolio.portfolio_view.display_maximum_drawdown_ratio
portfolio.distr,openbb_terminal.portfolio.portfolio_model.get_distribution_returns,openbb_terminal.portfolio.portfolio_view.display_distribution_returns
portfolio.maxdd,openbb_terminal.portfolio.portfolio_model.get_maximum_drawdown,openbb_terminal.portfolio.portfolio_view.display_maximum_drawdown
portfolio.rvol,openbb_terminal.portfolio.portfolio_model.get_rolling_volatility,openbb_terminal.portfolio.portfolio_view.display_rolling_volatility
portfolio.rsharpe,openbb_terminal.portfolio.portfolio_model.get_rolling_sharpe,openbb_terminal.portfolio.portfolio_view.display_rolling_sharpe
portfolio.rsortino,openbb_terminal.portfolio.portfolio_model.get_rolling_sortino,openbb_terminal.portfolio.portfolio_view.display_rolling_sortino
portfolio.rsort,openbb_terminal.portfolio.portfolio_model.get_rolling_sortino,openbb_terminal.portfolio.portfolio_view.display_rolling_sortino
portfolio.rbeta,openbb_terminal.portfolio.portfolio_model.get_rolling_beta,openbb_terminal.portfolio.portfolio_view.display_rolling_beta
portfolio.summary,openbb_terminal.portfolio.portfolio_model.get_summary,
portfolio.skew,openbb_terminal.portfolio.portfolio_model.get_skewness,
portfolio.kurtosis,openbb_terminal.portfolio.portfolio_model.get_kurtosis,
portfolio.volatility,openbb_terminal.portfolio.portfolio_model.get_volatility,
portfolio.sharpe,openbb_terminal.portfolio.portfolio_model.get_sharpe_ratio,
portfolio.sortino,openbb_terminal.portfolio.portfolio_model.get_sortino_ratio,
portfolio.maxdrawdown,openbb_terminal.portfolio.portfolio_model.get_maximum_drawdown_ratio,
portfolio.rsquare,openbb_terminal.portfolio.portfolio_model.get_r2_score,
portfolio.gaintopain,openbb_terminal.portfolio.portfolio_model.get_gaintopain_ratio,
portfolio.trackerr,openbb_terminal.portfolio.portfolio_model.get_tracking_error,
portfolio.information,openbb_terminal.portfolio.portfolio_model.get_information_ratio,
portfolio.tail,openbb_terminal.portfolio.portfolio_model.get_tail_ratio,
portfolio.commonsense,openbb_terminal.portfolio.portfolio_model.get_common_sense_ratio,
portfolio.jensens,openbb_terminal.portfolio.portfolio_model.get_jensens_alpha,
portfolio.calmar,openbb_terminal.portfolio.portfolio_model.get_calmar_ratio,
portfolio.kelly,openbb_terminal.portfolio.portfolio_model.get_kelly_criterion,
portfolio.payoff,openbb_terminal.portfolio.portfolio_model.get_payoff_ratio,
portfolio.profitfactor,openbb_terminal.portfolio.portfolio_model.get_profit_factor,
portfolio.alloc.assets,openbb_terminal.portfolio.portfolio_model.get_assets_allocation,
portfolio.alloc.sectors,openbb_terminal.portfolio.portfolio_model.get_sectors_allocation,
portfolio.alloc.countries,openbb_terminal.portfolio.portfolio_model.get_countries_allocation,
portfolio.alloc.regions,openbb_terminal.portfolio.portfolio_model.get_regions_allocation,
portfolio.metric.volatility,openbb_terminal.portfolio.portfolio_model.get_volatility,
portfolio.metric.sharpe,openbb_terminal.portfolio.portfolio_model.get_sharpe_ratio,
portfolio.metric.sortino,openbb_terminal.portfolio.portfolio_model.get_sortino_ratio,
portfolio.metric.maxdrawdown,openbb_terminal.portfolio.portfolio_model.get_maximum_drawdown_ratio,
portfolio.metric.rsquare,openbb_terminal.portfolio.portfolio_model.get_r2_score,
portfolio.metric.skew,openbb_terminal.portfolio.portfolio_model.get_skewness,
portfolio.metric.kurtosis,openbb_terminal.portfolio.portfolio_model.get_kurtosis,
portfolio.metric.gaintopain,openbb_terminal.portfolio.portfolio_model.get_gaintopain_ratio,
portfolio.metric.trackerr,openbb_terminal.portfolio.portfolio_model.get_tracking_error,
portfolio.metric.information,openbb_terminal.portfolio.portfolio_model.get_information_ratio,
portfolio.metric.tail,openbb_terminal.portfolio.portfolio_model.get_tail_ratio,
portfolio.metric.commonsense,openbb_terminal.portfolio.portfolio_model.get_common_sense_ratio,
portfolio.metric.jensens,openbb_terminal.portfolio.portfolio_model.get_jensens_alpha,
portfolio.metric.calmar,openbb_terminal.portfolio.portfolio_model.get_calmar_ratio,
portfolio.metric.kelly,openbb_terminal.portfolio.portfolio_model.get_kelly_criterion,
portfolio.metric.payoff,openbb_terminal.portfolio.portfolio_model.get_payoff_ratio,
portfolio.metric.profitfactor,openbb_terminal.portfolio.portfolio_model.get_profit_factor,
portfolio.perf,openbb_terminal.portfolio.portfolio_model.get_performance_vs_benchmark,
portfolio.var,openbb_terminal.portfolio.portfolio_model.get_var,
portfolio.es,openbb_terminal.portfolio.portfolio_model.get_es,
Expand Down
Loading