Closed deeleeramone closed 4 months ago
What is a category, and how do I load it? How do you take an optimized portfolio and "load it"?
Following the documentation for the load command, about load
:
2022 Aug 01, 03:02 /portfolio/po/ $ load -f allocation.xlsx
Error: [Errno 2] No such file or directory: 'allocation.xlsx'
Error: not enough values to unpack (expected 2, got 0)
Parameters
do not read defaults
and must be loaded, through file
, and then the function is not load
it is file
. Everywhere else in the terminal it is load preset
load ticker
, but here you load a file with file
.
After loading a portfolio in the /portfolio
menu, one would expect that same portfolio is "loaded" when you enter the po
submenu.
load
does not allow you to load a portfolio
that is your holdings
.
The command is --show_arguments
, which shows a message to go look somewhere else:
2022 Aug 01, 03:36 /portfolio/po/params/ $ arg -h
usage: arg [-a ARGUMENT ARGUMENT] [-s] [-h]
Set a different value for one of the available arguments.
options:
-a ARGUMENT ARGUMENT, --argument ARGUMENT ARGUMENT
Set a value for an argument (default: None)
-s, --show_arguments Show the available arguments, the options and a description. (default: False)
-h, --help show this help message (default: False)
For more information and examples, use 'about arg' to access the related guide.
2022 Aug 01, 03:36 /portfolio/po/params/ $ arg -s
Please adjust the parameters directly in the defaults.ini file.
What is the master list of parameters and arguments?
I disagree with the observation that there needs to be the option to create a portfolio. Portfolio optimization is complex, you can't just add a few tickers and optimize for that since it has no meaning and I wouldn't want the user to believe otherwise. The process of making adjustments to the portfolio starts with determining the portfolio attribution and then restricting exposure to e.g. sectors through Black Litterman or similar, not the other way around.
load does not allow you to load a portfolio that is your holdings.
@deeleeramone Care to elaborate? What's wrong with this? I see all tickers included.
Parameters do not read defaults and must be loaded, through file
@deeleeramone Same here, the default values are already set equal to defaults.ini, what's the issue here?
Points to work on (@montezdesousa could you look into this?):
about load
needs to get updated. Within the Introduction page this is actually correct.portfolio
and po
is currently off. We need to adjust for this. E.g. by unifying the allocation and holdings template.People do not need to use the portfolio functions strictly for one purpose only. There are plenty of useable functions that are not one-trick ponies - in both the portfolio and the portfolio optimization menus. People want to use the features, I don't believe that the software should artificially limit the capabilities of the user whom we have no idea what their true intentions are. We should give people the benefit of the doubt that they are capable of arriving at their own conclusions. Give people a min/max for the number of assets that can be "optimized" as a group, and let them have at it.
load does not allow you to load a portfolio that is your holdings.
@deeleeramone Care to elaborate? What's wrong with this? I see all tickers included.
You load a portfolio from the portfolio menu, and then you enter the portfolio optimization menu and this portfolio is not loaded, and are unable to load it from the load
function because it doesn't look in the folder that it is holdings
. Why do we need a portfolio
and an orderbook
file? Why can't I put holdings
through optimization functions?
If there is a file called "default parameters", it would make the most sense for those parameters to be set to the "default". It would be more user-friendly like this, and then users would be able to modify so not to have to go through the navigation and loading process of file
file
parameters_file.ini
.
- een
portfolio
andpo
is currently off. We need to adjustI disagree with the observation that there needs to be the option to create a portfolio. Portfolio optimization is complex, you can't just add a few tickers and optimize for that since it has no meaning and I wouldn't want the user to believe otherwise. The process of making adjustments to the portfolio starts with determining the portfolio attribution and then restricting exposure to e.g. sectors through Black Litterman or similar, not the other way around.
load does not allow you to load a portfolio that is your holdings.
@deeleeramone Care to elaborate? What's wrong with this? I see all tickers included.
Parameters do not read defaults and must be loaded, through file
@deeleeramone Same here, the default values are already set equal to defaults.ini, what's the issue here?
Points to work on (@montezdesousa could you look into this?):
about load
needs to get updated. Within the Introduction page this is actually correct.- Integration between
portfolio
andpo
is currently off. We need to adjust for this. E.g. by unifying the allocation and holdings template.- Add in more information when you load in an .ini file.
Sure. I got 2 questions:
portfolio
and po
broken by the refactoring of portfolio menu?People do not need to use the portfolio functions strictly for one purpose only. There are plenty of useable functions that are not one-trick ponies - in both the portfolio and the portfolio optimization menus. People want to use the features, I don't believe that the software should artificially limit the capabilities of the user whom we have no idea what their true intentions are. We should give people the benefit of the doubt that they are capable of arriving at their own conclusions. Give people a min/max for the number of assets that can be "optimized" as a group, and let them have at it.
load does not allow you to load a portfolio that is your holdings. @deeleeramone Care to elaborate? What's wrong with this? I see all tickers included.
You load a portfolio from the portfolio menu, and then you enter the portfolio optimization menu and this portfolio is not loaded, and are unable to load it from the
load
function because it doesn't look in the folder that it isholdings
. Why do we need aportfolio
and anorderbook
file? Why can't I putholdings
through optimization functions?If there is a file called "default parameters", it would make the most sense for those parameters to be set to the "default". It would be more user-friendly like this, and then users would be able to modify so not to have to go through the navigation and loading process of
file
file
parameters_file.ini
.
I don't see the problem, loading from portfolio
to po
works just fine for me. The defaults file is already set as the defaults. It is simply a file you can adjust if you so desire.
2022 Aug 03, 05:25 (🦋) / $ portfolio
load ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Portfolio ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ │
│ > bro brokers holdings, supports: robinhood, ally, degiro, coinbase │
│ > po portfolio optimization, optimize your portfolio weights efficiently │
│ │
│ load load data into the portfolio │
│ │
│ Loaded orderbook: │
│ Risk Free Rate: 0.00% │
│ │
│ show show existing transactions │
│ │
│ bench define the benchmark │
│ │
│ Benchmark: │
│ │
│ Graphs: │
│ holdv holdings of assets (absolute value) │
│ holdp portfolio holdings of assets (in percentage) │
│ yret yearly returns │
│ mret monthly returns │
│ dret daily returns │
│ distr distribution of daily returns │
│ maxdd maximum drawdown │
│ rvol rolling volatility │
│ rsharpe rolling sharpe │
│ rsort rolling sortino │
│ rbeta rolling beta │
│ │
│ Metrics: │
│ alloc allocation on an asset, sector, countries or regions basis │
│ summary all portfolio vs benchmark metrics for a certain period of choice │
│ metric portfolio vs benchmark metric for all different periods │
│ perf performance of the portfolio versus benchmark │
│ │
│ Risk Metrics: │
│ var display value at risk │
│ es display expected shortfall │
│ om display omega ratio │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── OpenBB Terminal v1.6.0 (https://openbb.co) ─╯
2022 Aug 03, 05:25 (🦋) /portfolio/ $ load Public_Equity_Orderbook.xlsx
Preprocessing orderbook: ..........
Loading price data: .
Calculating returns: .
Portfolio: Public_Equity_Orderbook.xlsx
Risk Free Rate: 0
2022 Aug 03, 05:25 (🦋) /portfolio/ $ po
╭────────────────────────────────────────────────────────────────────────────────────────────────────────── Portfolio - Portfolio Optimization ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ load load tickers and categories from .xlsx or .csv file │
│ │
│ Portfolio loaded: │
│ │
│ Tickers: AAPL, AMZN, APTV, ASML, BABA, DGX, GOOGL, NKE, TSM, YUM │
│ Categories: │
│ │
│ file select portfolio parameter file │
│ > params specify and show portfolio risk parameters │
│ │
│ Parameter file: │
│ │
│ Mean Risk Optimization: │
│ maxsharpe maximal Sharpe ratio portfolio (a.k.a the tangency portfolio) │
│ minrisk minimum risk portfolio │
│ maxutil maximal risk averse utility function, given some risk aversion parameter │
│ maxret maximal return portfolio │
│ maxdiv maximum diversification portfolio │
│ maxdecorr maximum decorrelation portfolio │
│ blacklitterman black litterman portfolio │
│ ef show the efficient frontier │
│ Risk Parity Optimization: │
│ riskparity risk parity portfolio using risk budgeting approach │
│ relriskparity relaxed risk parity using least squares approach │
│ Hierarchical Clustering Models: │
│ hrp hierarchical risk parity │
│ herc hierarchical equal risk contribution │
│ nco nested clustering optimization │
│ Other Optimization Techniques: │
│ equal equally weighted │
│ mktcap weighted according to market cap (property marketCap) │
│ dividend weighted according to dividend yield (property dividendYield) │
│ property weight according to selected info property │
│ │
│ Optimized portfolio: │
│ │
│ rpf remove portfolios from the list of saved portfolios │
│ show show selected portfolios and categories from the list of saved portfolios │
│ plot plot selected charts from the list of saved portfolios │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── OpenBB Terminal v1.6.0 (https://openbb.co) ─╯
2022 Aug 03, 05:25 (🦋) /portfolio/po/ $ maxsharpe
Optimization can take time. Please be patient...
[3 Years] Maximal return/risk ratio portfolio using volatility as risk measure
Weights
┏━━━━━━━┳━━━━━━━━━━┓
┃ ┃ Value ┃
┡━━━━━━━╇━━━━━━━━━━┩
│ AAPL │ 77.94 % │
├───────┼──────────┤
│ AMZN │ 0.00 % │
├───────┼──────────┤
│ APTV │ 0.00 % │
├───────┼──────────┤
│ ASML │ 10.21 % │
├───────┼──────────┤
│ BABA │ 0.00 % │
├───────┼──────────┤
│ DGX │ 4.56 % │
├───────┼──────────┤
│ GOOGL │ 0.00 % │
├───────┼──────────┤
│ NKE │ 0.00 % │
├───────┼──────────┤
│ TSM │ 7.30 % │
├───────┼──────────┤
│ YUM │ 0.00 % │
└───────┴──────────┘
Annual (by 252) expected return: 42.74%
Annual (by √252) volatility: 32.87%
Sharpe ratio: 1.2674
2022 Aug 03, 05:25 (🦋) /portfolio/po/ $ file defaults.ini
Parameters:
historic_period : 3y
log_returns : 0
return_frequency : d
max_nan : 0.05
threshold_value : 0.3
nan_fill_method : time
significance_level : 0.05
2022 Aug 03, 05:27 (🦋) /portfolio/po/ $ maxsharpe
Optimization can take time. Please be patient...
[3 Years] Maximal return/risk ratio portfolio using volatility as risk measure
Weights
┏━━━━━━━┳━━━━━━━━━━┓
┃ ┃ Value ┃
┡━━━━━━━╇━━━━━━━━━━┩
│ AAPL │ 77.94 % │
├───────┼──────────┤
│ AMZN │ 0.00 % │
├───────┼──────────┤
│ APTV │ 0.00 % │
├───────┼──────────┤
│ ASML │ 10.21 % │
├───────┼──────────┤
│ BABA │ 0.00 % │
├───────┼──────────┤
│ DGX │ 4.56 % │
├───────┼──────────┤
│ GOOGL │ 0.00 % │
├───────┼──────────┤
│ NKE │ 0.00 % │
├───────┼──────────┤
│ TSM │ 7.30 % │
├───────┼──────────┤
│ YUM │ 0.00 % │
└───────┴──────────┘
Annual (by 252) expected return: 42.74%
Annual (by √252) volatility: 32.87%
Sharpe ratio: 1.2674
- een
portfolio
andpo
is currently off. We need to adjustI disagree with the observation that there needs to be the option to create a portfolio. Portfolio optimization is complex, you can't just add a few tickers and optimize for that since it has no meaning and I wouldn't want the user to believe otherwise. The process of making adjustments to the portfolio starts with determining the portfolio attribution and then restricting exposure to e.g. sectors through Black Litterman or similar, not the other way around.
load does not allow you to load a portfolio that is your holdings.
@deeleeramone Care to elaborate? What's wrong with this? I see all tickers included.Parameters do not read defaults and must be loaded, through file
@deeleeramone Same here, the default values are already set equal to defaults.ini, what's the issue here? Points to work on (@montezdesousa could you look into this?):
about load
needs to get updated. Within the Introduction page this is actually correct.- Integration between
portfolio
andpo
is currently off. We need to adjust for this. E.g. by unifying the allocation and holdings template.- Add in more information when you load in an .ini file.
Sure. I got 2 questions:
- What do you mean by introduction page?
- Was the integration between
portfolio
andpo
broken by the refactoring of portfolio menu?
We created introduction pages for each menu (e.g. https://openbb-finance.github.io/OpenBBTerminal/terminal/portfolio/ and https://openbb-finance.github.io/OpenBBTerminal/terminal/portfolio/po/). Within the PO introduction page it says load OpenBB_Portfolio_Template_v1.0.0.xlsx
whereas the command it self (https://openbb-finance.github.io/OpenBBTerminal/terminal/portfolio/po/load/) tells you to do load -f allocation.xlsx
which doesn't work and should be load OpenBB_Portfolio_Template_v1.0.0.xlsx
.
Since our holdings
and allocation
template differ, we need to make sure they are close enough related that you don't run into any errors. This is something we didn't properly account for when creating the holdings
template and needs to be corrected.
See how it says a portfolio is not loaded? It is not passing the data through. Just the ticker names. Then after running the ef
optimization strategy, it does not appear in the Optimized Portfolio while others do. But then it is still can't find the information that it's looking for.
The allocation function is not returning the correct numbers for the difference. The benchmark is SPY.
@JerBouma Same here, the default values are already set equal to defaults.ini, what's the issue here?
Where do you see any default values loaded? I see none. You must load the defaults.ini
file before any parameters are set at all.
There is no ticker that will satisfy a cash deposit. It's not a foreign exchange of currency, it's a cash deposit.
@JerBouma Same here, the default values are already set equal to defaults.ini, what's the issue here?
Where do you see any default values loaded? I see none. You must load the
defaults.ini
file before any parameters are set at all.
If you do -h
on the optimizers you see the same defaults are already set.
There is no ticker that will satisfy a cash deposit. It's not a foreign exchange of currency, it's a cash deposit.
We currently assume the account is funded. Orderbooks don't generally include cash deposits and withdrawals.
If you do -h on the optimizers you see the same defaults are already set.
If there are parameters that are set, they should be shown and easily known by the user. The help dialogues for all of these commands are so verbose that it makes it extremely difficult to read. Parameters are also different per command, so how does one reconcile this in an efficient manner? Why can't they be displayed in an easily referenced list? Why does the user need to hunt to find this information? If a user is not able to use the arg
function in the params
menu, why is it there at all?
We currently assume the account is funded. Orderbooks don't generally include cash deposits and withdrawals.
I am loading a "portfolio". Cash is a position. There are choices for buy/sell/deposit/withdraw. If people are to connect their real portfolios into something like this, there is nearly a 100% chance of there being an amount of cash in there. What happens when you receive dividends? What happens when you trim or add to a position? What happens when you want to see the weighting in cash, like many fund managers are sitting on right now?
I think that for real world use cases, it is definitely desirable to be able to optionally include cash (and dividend payouts) in a portfolio analysis. An isolated view on a e.g. stocks-only portfolio cannot represent the 'true' asset allocation and risk-reward relationship of an investor.
I think that for real world use cases, it is definitely desirable to be able to optionally include cash (and dividend payouts) in a portfolio analysis. An isolated view on a e.g. stocks-only portfolio cannot represent the 'true' asset allocation and risk-reward relationship of an investor.
Yes, fully aware but for complexity reasons our first proof-of-concept excludes it. Furthermore, when you export orderbooks from brokers they generally also don't include cash injections.
In later stages this will indeed be included but the Portfolio menu is still in development and we are prioritizing actually being able to perform a sound analysis first.
I want to highlight here that the portfolio menu is a work-in-progress. There are clear shortfalls to the current implementation but that is expected since we are trying to create a MVP.
There are still so many considerations we do not take into account (which are all written down already on our backlog) but for now it is important that the insights you get are at least a reasonable approximation and I believe they are (minus the noted bugs here).
If you do -h on the optimizers you see the same defaults are already set.
If there are parameters that are set, they should be shown and easily known by the user. The help dialogues for all of these commands are so verbose that it makes it extremely difficult to read. Parameters are also different per command, so how does one reconcile this in an efficient manner? Why can't they be displayed in an easily referenced list? Why does the user need to hunt to find this information? If a user is not able to use the
arg
function in theparams
menu, why is it there at all?We currently assume the account is funded. Orderbooks don't generally include cash deposits and withdrawals.
I am loading a "portfolio". Cash is a position. There are choices for buy/sell/deposit/withdraw. If people are to connect their real portfolios into something like this, there is nearly a 100% chance of there being an amount of cash in there. What happens when you receive dividends? What happens when you trim or add to a position? What happens when you want to see the weighting in cash, like many fund managers are sitting on right now?
Portfolio optimization is simply not a straight-forward thing. The fact we integrated this in a terminal-view already is quite challenging. E.g. there is a reason the author of RiskfolioLib created a GUI instead. We do, however, provide the necessary explanation through the Excel template that is also shown in the Docs: https://openbb-finance.github.io/OpenBBTerminal/terminal/portfolio/po/ and which is encouraged to be used.
All of these parameters are massive considerations that have an incredibly large impact on the portfolio. Doing any meaningful optimization requires a well thought-out strategy in which the Excel compliments well. Currently, the menu to me is in a good shape despite the obvious bugs you pointed out. I see currently no reason to enhance the menu further given other priorities and current interest and applicability for a retail investor.
Cash positions is something we will look at later (it is on the backlog) also when broker integration is developed further. Right now it is fine to exclude, e.g. DEGIRO (largest broker in Europe) does not output cash positions within the orderbook file and the money market return is low enough.
My goal, and that of any user, is simply to use the features. The complexity of the subject matter has little to do with passing a data frame through functions that read parameters in an INI file, exactly like screeners do. Users are even encouraged to "go to the portfolio optimization menu" with a list of tickers. The workflow of the terminal is being blocked at this menu.
The default parameter file should be loaded, like how every other screener does. The program should also be smart enough to know what asset class, country, sector, and industry they belong to because this information is already known by the Terminal.
After optimizing a portfolio, one cannot do anything with it other than remove
show
plot
. There is no option to export
or load
it as a portfolio
. Even worse, a user backs up to the /portfolio
branch only to realize that: 1. It's not a portfolio that was saved anywhere that can be used. 2. it has been removed from memory, as evidenced by returning to the po
menu.
At this point I can either re-create the steps to get back to where I was, or give up. Most will give up.
We do, however, provide the necessary explanation through the Excel template that is also shown in the Docs: https://openbb-finance.github.io/OpenBBTerminal/terminal/portfolio/po/ and which is encouraged to be used.
Referring to the Excel template, it is immediately confusing and the explanations are inadequate. Users are not even able to find the folders that are described because they have been hidden. They don't know where the files are.
The example shows the program not functioning correctly. After loading a portfolio, current portfolio: none
.
Public_Equity_Orderbook
- Type is stocks, but categorization is public equity.
Public_Equity_Portfolio
- Type is Asset Class
A portfolio would have a quantity and cost average for each security, and historical reference points for acquisition/disposition/distribution.
Both orderbook
and allocation
have aliases as a portfolio
but neither function as a cohesive portfolio. The provided templates have the same stocks categorized in different industries. Why? Maintaining two "portfolios" with the same set of tickers and weightings, and keeping them current, is not a desirable workflow.
Previously, it made sense we direct people to the po
menu from different areas of the terminal since there was nothing available for users to create portfolios. Currently, this makes very little sense. Will create an internal ticket to remove these integrations from other menus, good point. This should also combat the errors (except when you visit portfolio --> po
) regarding the categories not being found when you try to optimise a portfolio.
Other points will also be handled internally in next sprint.
Previous title was missed, but the essence is that it is not simple to add a cash position to a portfolio.
With that said, there is no ability to
create portfolio
. Before the big refactor, when thepo
menu was entered through the functions that shortcut to it, one had the ability to create a portfolio that interacted with all the features in the menu, and were able to easily save or export to use in theportfolio
menu as well. It should be simple to create an "equal weight portfolio" based on a group of selected tickers or financial instruments, but it is not possible to do this currently.