diff --git a/README.md b/README.md index 4842d8ebbb1..ba579aea833 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ As a modern Python-based environment, OpenBBTerminal opens access to numerous Py If you wish to install the Terminal, there are currently four options: -- [Using the Installer](openbb_terminal/README.md#User) (recommended if you just want to use the terminal) +- [Using the Installer](https://openbb-finance.github.io/OpenBBTerminal/terminal/#accessing-the-openbb-terminal) (recommended if you just want to use the terminal) - [Using Python](openbb_terminal/README.md#anaconda--python) (recommended if you want to develop new features) - [Using Docker](openbb_terminal/README.md#Docker-Installation) (alternative option to the installer if preferred) - [Using Docker Web UI](openbb_terminal/README.md#web-ui---docker) (if you want to deploy the web UI for users to access diff --git a/guides/portfolio/portfolio_optimization/sub_level_template.md b/guides/portfolio/portfolio_optimization/sub_level_template.md index bc30166007e..2c4545c9874 100644 --- a/guides/portfolio/portfolio_optimization/sub_level_template.md +++ b/guides/portfolio/portfolio_optimization/sub_level_template.md @@ -6,6 +6,7 @@ type: our story status: publish excerpt: "The Introduction to ENTER_MENU_NAME_HERE within the ENTER_TOP_LEVEL_MENU_NAME_HERE explains how to use the ENTER_MENU_NAME_HERE and provides a brief description of its sub-menus" +geekdocCollapseSection: true --- **Important Rules** @@ -20,6 +21,7 @@ Each page should always take the following rules in mind: - Every link should open a new page (`_blank`). So use: `exp` - Some methods to format images: + - Include a link tot the image as well, e.g: `headlines` - Side by side: ` ` - Text and image: ``` @@ -36,8 +38,6 @@ Each page should always take the following rules in mind: ``` - No formatting in particular: `![image](link/to/image)` _____ - -

Introduction to ENTER_MENU_NAME_HERE

The purpose of the menu, providing very factual information with a neutral view. E.g. "The options menu is used to gain insights in different metrics involved around option contracts based on the selected ticker." diff --git a/guides/portfolio/top_level_menu.md b/guides/portfolio/top_level_menu.md index 75122f8eeaf..a18da5d6b44 100644 --- a/guides/portfolio/top_level_menu.md +++ b/guides/portfolio/top_level_menu.md @@ -6,6 +6,7 @@ type: our story status: publish excerpt: "The Introduction to ENTER_MENU_NAME_HERE explains how to use the ENTER_MENU_NAME_HERE and provides a brief description of its sub-menus" +geekdocCollapseSection: true --- **Important Rules** @@ -20,6 +21,7 @@ Each page should always take the following rules in mind: - Every link should open a new page (`_blank`). So use: `exp` - Some methods to format images: + - Include a link tot the image as well, e.g: `headlines` - Side by side: ` ` - Text and image: ``` @@ -36,8 +38,6 @@ Each page should always take the following rules in mind: ``` - No formatting in particular: `![image](link/to/image)` _____ - -

Introduction to ENTER_MENU_NAME_HERE

The purpose of the menu, providing very factual information with a neutral view. E.g. "The Stocks menu is used to gain insights in the asset class stocks via various areas like fundamental, behavioural and technical analysis" diff --git a/openbb_terminal/README.md b/openbb_terminal/README.md index 8637d24394a..a76b7bfa2a2 100644 --- a/openbb_terminal/README.md +++ b/openbb_terminal/README.md @@ -4,7 +4,6 @@

Table of Contents

    -
  1. General Installation Process
  2. Anaconda & Python Installation
  3. Docker Installation
  4. Docker Web UI Installation
  5. @@ -26,56 +25,7 @@ First step in all options is to star the project Github starts -If you want to install the terminal using Python ignore the User section and jump to -Anaconda & Python section. - -## User - -If you are interested in running the terminal via the installer, these steps will guide you through the installation -process and explain to you what each message means. - -### Windows - -The process starts off by downloading the installer, see below for how to download the most recent release: - -- Go to [the following link](https://github.com/OpenBB-finance/OpenBBTerminal/releases) -- Click on the most recent release -- Click on the ".exe" file: - -Then follow these steps: - -| Installation instructions | Illustration | -| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------ | -|
    Double click the .exe file that got downloaded to your "Downloads" folder. You will most likely receive the error on the right stating "Windows protected your PC". This is because the installer is still in beta phase, and the team has not yet requested verification from Windows.
    |

    Windows protected your PC

    | -|
    Click on "More info" and select "Run anyway" to start the installation process. Proceed by following the steps. Do note that if you wish to install the application to 'Program Files' that you will have to run the resulting application as Administrator. |

    Run anyway

    | -|
    By clicking on the application that appeared on your Desktop, you are able to run the Terminal. The first time this takes a bit longer to load. |

    Run the terminal

    | - -### macOS - -The process starts off by downloading the installer, see below for how to download the most recent release: - -- Go to [the following link](https://github.com/OpenBB-finance/OpenBBTerminal/releases) -- Click on the most recent release -- Click on the ".dmg" file: - -Installation instructions: - -1. Open the .dmg file that got downloaded to your "Downloads" folder. -2. Drag the folder into your "Applications" folder. This should take some time as it is extracting the - files from the .dmg file. -3. Open the folder and click on the "OpenBB Terminal" file, this should run the application. - -mac os installation - -| Note about "Cannot check it for malicious software" warning | Illustration | -| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | -|
    It is possible you will see the image displayed on the right. This is because the installer is still in beta phase, and the team has not yet requested verification from Apple. Please see below how to correct for this.
    |

    software warning

    | -|
    **Option 1 (via MacOS settings):**

    1) Run the file. You will most likely receive a message that macOS was not able to check whether the application contains malicious software. The reasoning for this is described above.
    2) Go to System Preferences > Security & Privacy > General. You should see a message at the bottom that says that the file "was blocked from use because it is not from an identified developer". Click on β€œAllow anyway” or "Open anyway".
    3) If you receive the above message multiple times on different files, keep allowing the files via Step 2 or use Option 2.
    4) You should now be able to launch the application. |

    option 1 warning fix

    | -|
    **Option 2 (via Terminal):**

    1) Run the file. You will most likely receive a message that macOS was not able to check whether the application contains malicious software. The reasoning for this is described in the note above.
    2) Open the "Terminal" application. This can be done by using Command (⌘) + Space and typing "terminal".
    3) Within this "Terminal" application, assuming you moved the file to the Applications folder, enter the following command: `xattr -r -d com.apple.quarantine "/Applications/OpenBB Terminal"`
    4) You should now be able to launch the application. |

    option 2 warning fix

    | - -## Developer - -### Anaconda & Python +## Anaconda & Python This installation type supports both Windows and Unix systems (Linux + MacOS). However, on Windows it can become messy so it is easier to use Windows Subsystem Linux (WSL) on this operating system. WSL emulates a Linux machine inside your @@ -84,7 +34,7 @@ Windows system. If you are using macOS or other Linux operating systems you can jump the next section Installing the terminal. -#### Installing WSL (Only for Windows users) +### Installing WSL (Only for Windows users) If you are using Windows you first you need to install WSL. The process is simple and a tutorial can be found [here](https://www.sitepoint.com/wsl2/). Once you reach the section **Update Linux** on that tutorial, you should have a linux machine installed and can proceed @@ -111,7 +61,7 @@ Although we **extremely** recommend using WSL to run the terminal on windows, if you can try install the terminal directly on Windows without WSL. If you'd like to see a video recording of the installation on Windows without WSL, @JohnnyDankseed has made one available [here](https://www.youtube.com/watch?v=-DJJ-cfquDA). -#### Installing the terminal +### Installing the terminal These steps are common in all operating systems (Windows with or without WSL, MacOS or Linux). @@ -234,7 +184,7 @@ before you call `python terminal.py` again. troubleshoot page. You can also reach for help on our [discord](https://discord.gg/Up2QGbMKHY). -### Advanced User Install - Machine Learning +## Advanced User Install - Machine Learning If you are an advanced user and use other Python distributions, we have several requirements.txt documents that you can pick from to download project dependencies. @@ -272,7 +222,7 @@ conda install -c conda-forge tensorflow==2.7.0 python terminal.py ``` -### Update Terminal +## Update Terminal The terminal is constantly being updated with new features and bug fixes, hence, for your terminal to be update, you can run: @@ -299,7 +249,7 @@ If you `stashed` your changes previously, you can un-stash them with: git stash pop ``` -### Docker Installation +## Docker Installation 1. Make sure docker desktop is installed. Install links can be found [here](https://www.docker.com/products/docker-desktop). To confirm that your docker desktop is downloaded and running, open a command prompt or terminal and enter @@ -346,7 +296,7 @@ git stash pop environment keys and how to configure your X-server to show plots, hop over to the [Advanced Docker Setup](/DOCKER_ADVANCED.md). -### Web UI - Docker +## Web UI - Docker 1. Ensure Docker is installed. 2. Navigate to the location of the Dockerfile in the repo (`cd openbb_terminal_web`) @@ -361,7 +311,7 @@ Set the API keys [as explained here](https://github.com/OpenBB-finance/OpenBBTer Once you've put the API keys in that file, re-run the launch script, and it will use your API keys. There are a few things that still don't work, and you can see what works and what doesn't [here](https://github.com/CoconutMacaroon/OpenBBTerminal/blob/main/openbb_terminal_web/README.md#todo). -### Local Installation of GST on Raspberry Pi +## Local Installation of GST on Raspberry Pi 1. Running raspbian lite(headless) or desktop (both 64bit) we should first start off with an update/upgrade. @@ -459,21 +409,11 @@ before you call `python terminal.py` again. ### API Keys The project is build around several different API calls, whether it is to access historical data or financials. -The table below shows the ones where a key is necessary. +The table below shows the ones where a key is necessary. The easiest way is of updating the keys is by using the +terminal, see [this guide](https://openbb-finance.github.io/OpenBBTerminal/terminal/#accessing-other-sources-of-data-via-api-keys). -The easiest way is of updating the keys is by using the terminal. You are able to directly set these variables from -within the "keys" menu. This menu can be found on the first menu you see when opening the terminal. - -API Keys 1 - -Then, by typing the command on the left-hand side, followed by your API Key, you can set the key and use the commands -attached to it. - -API Keys 2 - -When you have installed the terminal through Anaconda & Python, you can use the environment variable to set your -API Keys directly instead of using the Terminal, for the variable name in the code one just needs to -remove the "GT\_", this can be found in [config_terminal.py](/openbb_terminal/config_terminal.py). +You can also use the environment variable to set your API Keys directly instead of using the Terminal, for the variable +name in the code one just needs to remove the "GT\_", this can be found in [config_terminal.py](/openbb_terminal/config_terminal.py). | Website | Environment Variables | | :--------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/portfolio/allocation/OpenBB_Portfolio_Template_v1.0.0.xlsx b/portfolio/allocation/OpenBB_Portfolio_Template_v1.0.0.xlsx index c22167c78a7..8dfbece9815 100644 Binary files a/portfolio/allocation/OpenBB_Portfolio_Template_v1.0.0.xlsx and b/portfolio/allocation/OpenBB_Portfolio_Template_v1.0.0.xlsx differ diff --git a/routines/comparison_demo.openbb b/routines/comparison_demo.openbb new file mode 100644 index 00000000000..7511372fcce --- /dev/null +++ b/routines/comparison_demo.openbb @@ -0,0 +1,53 @@ +# Select location folder to export data to (if doesn't exist, will be created by default) +# export didier_analysis_on_$ARGV[0] + +# Go into the stocks context +stocks + +# Load a ticker that's given as a first argument of the routine +load WMT + +# Go into the Comparison Analysis Menu +ca + +# Get similar companies +getfinnhub +getfinviz +getpoly + +# Remove and add a ticker +rmv JCP +add SHOP + +# Show a correlation matrix with different periods. +hcorr +hcorr -s 2022-01-01 + +# Compare valuations +valuation + +# Compare performance +performance + +# Sentiment of companaies over the last ten days +sentiment + +# Chart the NASDAQ 100 Index with futures contracts +.. +.. +stocks +ca +set ^NDX,NQH23.CME,NQZ22.CME,NQ=F +historical -s 2022-01-01 + +# Show the price-normalized history of S&P, NASDAQ, and Bitcoin futures +set ES=F,NQ=F,BTC=F +historical -n + +# Compare financial statements of the ten largest US Banks +set C,USB,WFC,JPM,TD,GS,PNC,TFC,BAC,COF +cashflow +income + +# Take the list of similar companies to the Portfolio Optimization Menu +po \ No newline at end of file diff --git a/routines/darkpool_demo.openbb b/routines/darkpool_demo.openbb new file mode 100644 index 00000000000..956afa7672d --- /dev/null +++ b/routines/darkpool_demo.openbb @@ -0,0 +1,48 @@ +# Select location folder to export data to (if doesn't exist, will be created by default) +# export didier_analysis_on_$ARGV[0] + +# Go into the stocks context +stocks + +# Navigate to Dark Pools and Short Data Menu +dps + +# Show the most shorted stocks on Yahoo Finance +shorted + +# Show the stocks with the highest short interest on https://highshortinterest.com +hsi + +# Get the top five NMS and OTCE symbols with increasing dark pool volume from https://otctransparency.finra.org/otctransparency/AtsIssueData +prom -n 50 -l 5 -t T1 +prom -n 50 -l 5 -t T2 +prom -n 50 -l 5 -t OTCE + +# Show the top 25 largest Dark Pool positions from https://stockgrid.io +pos -l 25 +pos -l 25 -a + +# Get the Cost-to-Borrow List +ctb + +# Get the days-to-cover list and sort +sidtc -s si +sidtc + +# Load Apple as a ticker +load AAPL + +# Short Volume vs Position +spos + +# Price vs. Short Interest +psi + +# Get two years of FTD data +ftd -s 2020-05-30 + +# Bar graph of Dark Pool and OTC volume +dpotc + +# Export the Cost-to-Borrow list as a spreadsheet to examine. +ctb -n 6000 --export xlsx \ No newline at end of file diff --git a/website/content/terminal/_index.md b/website/content/terminal/_index.md index f426aad069a..13b0bf9942d 100644 --- a/website/content/terminal/_index.md +++ b/website/content/terminal/_index.md @@ -50,7 +50,7 @@ and portfolio managers. The OpenBB Terminal can be directly installed on your computer via our installation program. Within this section, you are guided through the installation process and how to launch the program. If you are a developer, please have a look here. If you struggle with the -installation process, please don't hesitate to reach us on Discord +installation process, please don't hesitate to reach us on Discord or visit our contact page. ### Installation for Windows @@ -136,7 +136,7 @@ will see a command named load. To unde 2022 May 19, 05:27 (πŸ¦‹) /stocks/ $ load -h usage: load [-t TICKER] [-s START] [-e END] [-i {1,5,15,30,60}] [--source {yf,av,iex,polygon}] [-p] [-f FILEPATH] [-m] [-w] [-r {ytd,1y,2y,5y,6m}] [-h] -Load stock ticker to perform analysis on. When the data source is syf', an Indian ticker can be loaded by using '.NS' at the end, e.g. 'SBIN.NS'. See available market in https://help.yahoo.com/kb/exchanges-data-providers-yahoo-finance-sln2310.html. +Load stock ticker to perform analysis on. When the data source is yf (Yahoo Finance), an Indian ticker can be loaded by using '.NS'at the end, e.g. 'SBIN.NS'. See available market in https://help.yahoo.com/kb/exchanges-data-providers-yahoo-finance-sln2310.html. optional arguments: -t TICKER, --ticker TICKER @@ -310,5 +310,5 @@ question) and message in the form although this can also be set directly from in Alternatively, you can contact us via the following routes: - If you notice that a feature is missing inside the terminal, please fill in the Request a Feature form. -- If you wish to report a bug, have a question/suggestion or anything else, please fill in the Support form. -- If you wish to speak to us directly, please contact us via Discord. +- If you wish to report a bug, have a question/suggestion or anything else, please fill in the Support form. +- If you wish to speak to us directly, please contact us via Discord. diff --git a/website/content/terminal/portfolio/po/_index.md b/website/content/terminal/portfolio/po/_index.md index 407539f4df3..b4ea914bc31 100644 --- a/website/content/terminal/portfolio/po/_index.md +++ b/website/content/terminal/portfolio/po/_index.md @@ -1,52 +1,417 @@ --- +title: Introduction to Portfolio Optimization +keywords: "portfolio, optimization, mean variance, risk parity, black litterman, mean risk, +hierarchical clustering models" +excerpt: "The Introduction to Portfolio Optimization within the Portfolio menu explains how to use various portfolio +optimization techniques and provides a brief description of its sub-menus" geekdocCollapseSection: true --- +The Portfolio Optimization menu allows the user to apply advanced optimization techniques to a portfolio of any type +and of any size. It does so by introducing a multitude of optimization techniques ranging from mean-variance optimization +to risk parity models and +hierarchical clustering models. +By providing Excel templates, the user can make sense of the vast array of parameters that each command has. E.g. think +of the historic period you wish to use or which of the more than 10 risk measures and covariance methods should be used? +These are questions the templates make easier to answer. -The terminal has incorporated Riskfolio-Lib. Refer to the documentation here: +## How to use +The portfolio optimization menu can be reached by visiting the `portfolio` menu and typing `po` (or alternatively, +typing `/portfolio/po` from any location). This opens the following menu: -```text -Parameter file: +portfolio optimiation menu - file select portfolio parameter file -> params specify and show portfolio risk parameters - load load tickers and categories from .xlsx or .csv file +This menu requires the usage of the Excel templates to work properly. As there is a lot of complexity involved around +these techniques, these templates allow the user to understand what values for each parameter are actually used and +allow for an easy way to define the allocation. -Portfolio Optimization: - add add tickers to the list of the tickers to be optimized - rmv remove tickers from the list of the tickers to be optimized - show show selected portfolios and categories from the list of saved portfolios - rpf remove portfolios from the list of saved portfolios - plot plot selected charts from the list of saved portfolios +For this there are two templates that need to be set: +- **OpenBB Parameters Template**: found in the OpenBB Terminal directory within `OpenBB Terminal/OpenBB/portfolio/parameters` +- **OpenBB Portfolio Template**: found in the OpenBB Terminal directory within `OpenBB Terminal/OpenBB/portfolio/allocation` -Tickers: BLL, CLX, CSCO, DE, HD, IBM, MAS, MTB, OKE, PCG, RCL, SCHW, SYY, VZ, XRAY -Categories: ASSET_CLASS, SECTOR, INDUSTRY, COUNTRY, CURRENT_INVESTED_AMOUNT, CURRENCY -Portfolios: MINRISK_0, MAXSHARPE_1 +If this location does not exist, use this link +to download the most recent versions and place the contents inside a folder named `portfolio` within the `OpenBB Terminal/OpenBB` directory. -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 +### OpenBB Parameters Template +This template provides the user with the ability to set define values for each parameter based on the optimization +technique that is deployed. E.g. if you select `riskparity` for the `technique` parameter, you will notice that some +parameters turn grey. This means that the parameter is irrelevant for the selected +method. -Risk Parity Optimization: - riskparity risk parity portfolio using risk budgeting approach - relriskparity relaxed risk parity using least squares approach +The OpenBB Terminal does, however, allow the user to run any model despite the `technique` you selected. Therefore, if +you are interested in running multiple models, consider removing the value for `technique`. Do note that this makes it +more difficult to understand which values are used for which model. -Hierarchical Clustering Models: - hrp hierarchical risk parity - herc hierarchical equal risk contribution - nco nested clustering optimization +OpenBB Parameters Template -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 +Once you have defined the parameters, save the template and load it inside the terminal by using the file +command. If done correctly, the parameters file should show automatically after typing `file` and pressing SPACE. Then, by using the DOWN KEY (βŒ„) +you can select the file by pressing ENTER (⏎) which will then be loaded into the terminal: + +```` +2022 May 02, 06:51 (πŸ¦‹) /portfolio/po/ $ file OpenBB_Parameters_Template v1.0.0.xlsx +Parameters: + historic_period : 3y + log_returns : 0 + return_frequency : d + max_nan : 0.05 + threshold_value : 0.3 + nan_fill_method : time + risk_free : 0.003 + significance_level : 0.05 + risk_measure : MV + target_return : -1 + target_risk : -1 + expected_return : hist + covariance : hist + smoothing_factor_ewma : 0.94 + long_allocation : 1 + short_allocation : 0 +```` + +### OpenBB Portfolio Template +This template hands the user a format to work with it to define the portfolio. Here, categorization is applied +based on asset class, sector, industry, country and currency. By using the dropdown menus within this Excel, you +are able to apply the proper categorization. This is based on the same methodology as found in other areas of the +terminal. + +OpenBB Portfolio Template + +You can load in the portfolio template by using the load command: + +``` +2022 Apr 26, 01:35 (πŸ¦‹) /portfolio/po/ $ load OpenBB_Portfolio_Template_v1.0.0.xlsx +2022 Apr 26, 02:15 (πŸ¦‹) /portfolio/po/ $ show + +Current Portfolios: None + +Current Categories: ASSET_CLASS, SECTOR, INDUSTRY, COUNTRY, CURRENT_INVESTED_AMOUNT, CURRENCY ``` -{{< toc-tree >}} \ No newline at end of file +### Performing optimization +Based on the parameters and allocation the user has set, the optimization process begins. What optimization +technique is ideal depends entirely on the user's risk profile and objectives. As an illustration, +Risk Parity +is presented below via the riskparity +command: + +``` +2022 May 30, 05:47 (πŸ¦‹) /portfolio/po/ $ riskparity +Optimization can take time. Please be patient... + + [3 Years] Risk parity portfolio based on risk budgeting approach +using volatility as risk measure + + + Weights +┏━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Value ┃ +┑━━━━━━━╇━━━━━━━━━━┩ +β”‚ AAPL β”‚ 3.27 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ AMZN β”‚ 3.81 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ APTV β”‚ 2.17 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ ASML β”‚ 2.48 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ BABA β”‚ 3.42 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ GOOGL β”‚ 3.54 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ HYG β”‚ 9.40 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ IYR β”‚ 3.98 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ NKE β”‚ 3.66 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ PEX β”‚ 3.88 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ PSP β”‚ 3.49 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ REZ β”‚ 4.08 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TIP β”‚ 26.61 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TLT β”‚ 22.86 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TSM β”‚ 3.35 % β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + +Annual (by 252) expected return: 10.03% +Annual (by √252) volatility: 11.62% +Sharpe ratio: 0.8373 +``` +To understand how this portfolio differs from the original portfolio, the show +command can be used. This also shows the allocations to each asset class, sector, industry and currency. Using the +optimized portfolio, this generates the following results: + +``` +2022 May 30, 05:47 (πŸ¦‹) /portfolio/po/ $ show RP_0 + +Portfolio - RP_0 + + Category - Asset_Class +┏━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Asset_Class ┃ Current_Invested_Amount ┃ Current_Weights ┃ Value ┃ +┑━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩ +β”‚ USD β”‚ FIXED INCOME β”‚ 2,550,000 $ β”‚ 30.03 % β”‚ 58.87 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ PRIVATE EQUITY β”‚ 850,000 $ β”‚ 10.01 % β”‚ 7.37 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ PUBLIC EQUITY β”‚ 4,242,000 $ β”‚ 49.95 % β”‚ 25.69 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ REAL ESTATE β”‚ 850,000 $ β”‚ 10.01 % β”‚ 8.07 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL USD β”‚ 8,492,000 $ β”‚ 100.00 % β”‚ 100.00 % β”‚ +β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + + + + Category - Country +┏━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Country ┃ Current_Invested_Amount ┃ Current_Weights ┃ Value ┃ +┑━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩ +β”‚ USD β”‚ CHINA β”‚ 246,000 $ β”‚ 2.90 % β”‚ 3.42 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ NETHERLANDS β”‚ 920,000 $ β”‚ 10.83 % β”‚ 2.48 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TAIWAN β”‚ 380,000 $ β”‚ 4.47 % β”‚ 3.35 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ UNITED STATES β”‚ 6,946,000 $ β”‚ 81.79 % β”‚ 90.76 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL USD β”‚ 8,492,000 $ β”‚ 100.00 % β”‚ 100.00 % β”‚ +β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + + + + Category - Sector +┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Sector ┃ Current_Invested_Amount ┃ Current_Weights ┃ Value ┃ +┑━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩ +β”‚ USD β”‚ COMMUNICATION SERVICES β”‚ 636,000 $ β”‚ 7.49 % β”‚ 3.54 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ CONSUMER CYCLICAL β”‚ 1,926,000 $ β”‚ 22.68 % β”‚ 13.06 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ CORPORATE BOND β”‚ 810,000 $ β”‚ 9.54 % β”‚ 9.40 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ FINANCIAL β”‚ 850,000 $ β”‚ 10.01 % β”‚ 7.37 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ GOVERNMENT BOND β”‚ 1,740,000 $ β”‚ 20.49 % β”‚ 49.47 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ REAL ESTATE β”‚ 850,000 $ β”‚ 10.01 % β”‚ 8.07 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TECHNOLOGY β”‚ 1,680,000 $ β”‚ 19.78 % β”‚ 9.09 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL USD β”‚ 8,492,000 $ β”‚ 100.00 % β”‚ 100.00 % β”‚ +β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + + + + Category - Industry +┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Industry ┃ Current_Invested_Amount ┃ Current_Weights ┃ Value ┃ +┑━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩ +β”‚ USD β”‚ AUTO PARTS & EQUIPMENT β”‚ 429,000 $ β”‚ 5.05 % β”‚ 2.17 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ FINANCIAL SERVICES β”‚ 850,000 $ β”‚ 10.01 % β”‚ 7.37 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ FOOTWEAR & ACCESSORIES β”‚ 505,000 $ β”‚ 5.95 % β”‚ 3.66 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ HIGH YIELD BOND β”‚ 810,000 $ β”‚ 9.54 % β”‚ 9.40 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ INFLATION-PROTECTED BOND β”‚ 890,000 $ β”‚ 10.48 % β”‚ 26.61 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ INTERACTIVE MEDIA & SERVICES β”‚ 636,000 $ β”‚ 7.49 % β”‚ 3.54 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ INTERNET & DIRECT MARKETING RETAIL β”‚ 992,000 $ β”‚ 11.68 % β”‚ 7.23 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ LONG GOVERNMENT β”‚ 850,000 $ β”‚ 10.01 % β”‚ 22.86 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ RESIDENTIAL β”‚ 280,000 $ β”‚ 3.30 % β”‚ 4.08 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ SEMICONDUCTORS β”‚ 1,300,000 $ β”‚ 15.31 % β”‚ 5.82 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TECHNOLOGY HARDWARE, STORAGE & PERIPHERALS β”‚ 380,000 $ β”‚ 4.47 % β”‚ 3.27 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL MARKET β”‚ 570,000 $ β”‚ 6.71 % β”‚ 3.98 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL USD β”‚ 8,492,000 $ β”‚ 100.00 % β”‚ 100.00 % β”‚ +β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +It is possible to use the commands without loading in the parameters template or by using the parameters template but +changing some arguments directly into the terminal. For example, using the same method as described above, the risk +measure is changed to Conditional Value at Risk (CVaR) +and the used historic period is increased to 10 years (keeping all other parameters unchanged): + +``` +2022 May 30, 05:47 (πŸ¦‹) /portfolio/po/ $ riskparity -rm CVaR -p 10y +Optimization can take time. Please be patient... + + [10 Years] Risk parity portfolio based on risk budgeting approach +using conditional value at risk (CVaR) as risk measure + + + Weights +┏━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Value ┃ +┑━━━━━━━╇━━━━━━━━━━┩ +β”‚ AAPL β”‚ 3.78 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ AMZN β”‚ 3.55 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ APTV β”‚ 3.06 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ ASML β”‚ 3.11 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ GOOGL β”‚ 3.80 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ HYG β”‚ 11.68 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ IYR β”‚ 4.68 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ NKE β”‚ 4.31 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ PSP β”‚ 4.54 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ REZ β”‚ 4.91 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TIP β”‚ 29.23 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TLT β”‚ 19.69 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ TSM β”‚ 3.66 % β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + +Annual (by 252) expected return: 9.70% +Annual (by √252) volatility: 8.34% +Sharpe ratio: 1.1275 +Annual (by √252) conditional value at risk (CVaR) : 19.84% +Return / conditional value at risk (CVaR) ratio: 0.4738 +``` + +## Examples +To demonstrate the capabilities of the Portfolio Optimization menu, the entire S&P 500 index (as of 30th of May 2022) +is used and optimized and analysed in a variety of ways. Starting by loading in the dataset, which is visible when +you type `load` as it resides in the same directory as the earlier mentioned template: + +Load S&P 500 File within OpenBB Terminal + +It is possible to load the parameters template here but this is not necessary as each parameter has a default +value set regardless. However, because the Excel file provides a more structured way of presenting the choices, the +template is loaded in: +``` +2022 May 30, 06:15 (πŸ¦‹) /portfolio/po/ $ file OpenBB_Parameters_Template_v1.0.0.xlsx +Parameters: + historic_period : 3y + log_returns : 0 + return_frequency : d + max_nan : 0.05 + threshold_value : 0.3 + nan_fill_method : time + risk_free : 0.003 + significance_level : 0.05 + risk_measure : MV + target_return : -1 + target_risk : -1 + expected_return : hist + covariance : hist + smoothing_factor_ewma : 0.94 + long_allocation : 1 + short_allocation : 0 +``` + +Then, the Hierarchical Risk Parity technique is applied by running the hrp +command. This results in the following (the result is edited, as it would show 500 tickers, to prevent flooding this page): +``` +2022 May 30, 06:22 (πŸ¦‹) /portfolio/po/ $ hrp +Optimization can take time. Please be patient... + + [3 Years] Hierarchical risk parity portfolio using pearson codependence, +single linkage and volatility as risk measure + + + Weights +┏━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Value ┃ +┑━━━━━━━╇━━━━━━━━━━┩ +β”‚ A β”‚ 0.23 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ AAL β”‚ 0.04 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ AAP β”‚ 0.21 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ AAPL β”‚ 0.15 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ ABBV β”‚ 0.41 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ ABC β”‚ 0.18 % β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ + + +Annual (by 252) expected return: 19.65% +Annual (by √252) volatility: 21.64% +Sharpe ratio: 0.8943 +``` +This optimization process is then compared with the current holdings. To keep things manageable, only the sector +allocations are compared between the unoptimized and optimized portfolio which is done with the show +command: +``` +2022 May 31, 03:31 (πŸ¦‹) /portfolio/po/ $ show HRP_0 -ct SECTOR + + Category - Sector +┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓ +┃ ┃ Sector ┃ Current_Invested_Amount ┃ Current_Weights ┃ Value ┃ +┑━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩ +β”‚ USD β”‚ COMMUNICATION SERVICES β”‚ 14,934,743 $ β”‚ 5.89 % β”‚ 6.07 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ CONSUMER DISCRETIONARY β”‚ 31,210,119 $ β”‚ 12.31 % β”‚ 9.58 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ CONSUMER STAPLES β”‚ 15,957,911 $ β”‚ 6.29 % β”‚ 11.93 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ ENERGY β”‚ 9,582,634 $ β”‚ 3.78 % β”‚ 1.97 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ FINANCIALS β”‚ 30,165,029 $ β”‚ 11.89 % β”‚ 8.93 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ HEALTH CARE β”‚ 31,802,164 $ β”‚ 12.54 % β”‚ 17.35 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ INDUSTRIALS β”‚ 38,183,932 $ β”‚ 15.06 % β”‚ 14.04 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ INFORMATION TECHNOLOGY β”‚ 37,669,554 $ β”‚ 14.85 % β”‚ 12.95 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ MATERIALS β”‚ 14,155,430 $ β”‚ 5.58 % β”‚ 5.49 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ REAL ESTATE β”‚ 17,137,343 $ β”‚ 6.76 % β”‚ 4.82 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ UTILITIES β”‚ 12,808,749 $ β”‚ 5.05 % β”‚ 6.87 % β”‚ +β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ USD β”‚ TOTAL USD β”‚ 253,607,608 $ β”‚ 100.00 % β”‚ 100.00 % β”‚ +β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` +This table shows how the portfolio changed and how much is allocated to each sector. It is possible to delve further +into these findings with the plot +command. This gives the ability to visually depict allocations, e.g. below the sector allocation is visually depicted. + +```` +2022 May 31, 03:39 (πŸ¦‹) /portfolio/po/ $ plot HRP_0 -ct SECTOR -pi +```` + +Sectors Pie Chart + +Further analysis can be done by looking at the portfolio's returns histogram +which also includes a variety of risk measures as well as the portfolio's drawdowns. +```` +2022 May 31, 03:39 (πŸ¦‹) /portfolio/po/ $ plot HRP_0 -ct SECTOR -hi -dd +```` +Portfokio Returns Histogram +Portfolio Drawdowns + +Next to that, to delve deeper in the underlying conclusions the HRP method has drawn. Here, a closer look can be given +to the assets cluster map, which links certain categories to each other. The linkage process is done per asset basis but +here it is grouped per sector. Based on these results, the user can identify whether the optimization techniques also +logically makes sense. +```` +2022 May 31, 03:45 (πŸ¦‹) /portfolio/po/ $ plot HRP_0 -ct SECTOR -rc -he +```` +Heatmap with Linkage Method +Risk Contributions diff --git a/website/content/terminal/stocks/comparison_analysis/_index.md b/website/content/terminal/stocks/comparison_analysis/_index.md index 093e02e215d..97bd097654c 100755 --- a/website/content/terminal/stocks/comparison_analysis/_index.md +++ b/website/content/terminal/stocks/comparison_analysis/_index.md @@ -1,5 +1,105 @@ --- +title: Introduction to Comparison Analysis +keywords: "Comparison, analysis, ca, menu, submenu, stocks, compare, correlation, similar, historical, hcorr, volume, income, balance, cashflow, sentiment, scorr, overview, valuation, financial, ownership, performance, technical, tsne, getpoly, getfunnhub, getfinviz, set, add, rmv, Polygon, Finnhub, Finviz, Yahoo, yFinance, FinBrain, market, watch " +date: "2022-05-27" +type: guides +status: publish +excerpt: "An Introduction to Comparison Analysis, within the Stocks Menu, with a brief overview of the features." geekdocCollapseSection: true --- +The Comparison Analysis menu provides the user with tools for: + - searching and populating a list of companies that are similar to the loaded ticker. + - building a correlation matrix. + - comparing the price and volume history of multiple companies. + - comparing financial statements, technical performance, and ownership statistics of otherwise similar companies. + - comparing sentiment of similar companies. + - building a list of companies to use features from the Portfolio Optimization menu. -{{< toc-tree >}} +To use all features in this menu, the following API keys (free) must be obtained by the user: + + - Finnhub `getfinnhub` + - Polygon `getpoly` + +It is not necessary to load a ticker from the stocks menu to use these features. Enter the Comparison Analysis submenu by typing `ca` and pressing `ENTER` (⏎). + +Comparison Analysis Menu + +## How to use + +To add a primary ticker, or to swap it for another, enter `ticker AMZN`. The three commands: `getfinnhub`, `getpoly` +and `getfinviz` all provide a similar function. Sources may return different results. + +```` +(πŸ¦‹) /stocks/ca/ $ getfinviz +[Finviz] Similar Companies: WMT, BIG, BJ, COST, DG, DLTR, OLLI, PSMT, TGT, TUEM + +(πŸ¦‹) /stocks/ca/ $ getpoly +[Polygon] Similar Companies: WMT, AMZN, COST, EBAY, DLTR, KSS, JCP, TGT, M, DG + +(πŸ¦‹) /stocks/ca/ $ getfinnhub +[Finnhub] Similar Companies: WMT, COST, BJ, PSMT +```` +Using any of these commands will automatically populate the list of similar companies for analysis. Furthermore, `add` & `rmv` allows the user to make modifications, or create a list from scratch. + +Get similar companies for analysis + +To show a correlation matrix, use the `hcorr` command. The start dates can be modified, which changes the results, to show correlation over different periods. For example, obtain a one year correlation matrix with `hcorr`: + +One year correlation matrix + +Or, by adjusting the date, it is possible to define a correlation matrix with a different time horizon, e.g `hcorr -s 2022-01-01`: + +YTD correlation matrix + +The list of similar companies can be compared by a number of fundamental metrics. + +`valuation` displays earnings and valuation multiples. +Valuation + +`performance` compares technical performance of similar companies: +Performance + +`sentiment` is a chart from Finbrain that shows sentiment over the last ten days. +Performance + +This list of similar companies can be imported directly to the Portfolio Optimization menu by using the command, `po`. +PO Menu + +## Examples + +The correlation matrix can also be used in other ways, like measuring sectors or asset classes. The chart below is a daily, price-normalized, comparison of S&P, NASDAQ, and BTC futures. + +```` +(πŸ¦‹) /stocks/ca/ $ add es=f +[Custom] Similar Companies: ES=F, NQ=F, BTC=F + +(πŸ¦‹) /stocks/ca/ $ historical -n +```` +Historical + +This is a chart of the NASDAQ 100 Index, and three different futures contracts that are trading against it. + +```` +(πŸ¦‹) /stocks/ca/ $ set ^NDX,NQH23.CME,NQZ22.CME,NQ=F +[Custom] Similar Companies: ^NDX, NQH23.CME, NQZ22.CME, NQ=F + +(πŸ¦‹) /stocks/ca/ $ historical +```` +Historical NASDAQ 100 + +Compare financial statements of the ten largest US banks. +```` +(πŸ¦‹) /stocks/ca/ $ set C,USB,WFC,JPM,TD,GS,PNC,TFC,BAC,COF +[Custom] Similar Companies: C, USB, WFC, JPM, TD, COF, PNC, TFC, BAC, GS +(πŸ¦‹) /stocks/ca/ $ cashflow +```` +Cashflow comparison of the ten largest US banks + +Compare the income statements. + +```` +(πŸ¦‹) /stocks/ca/ $ income +```` +Income statements of the ten largest US banks + +To run a demonstration of the commands presented here, in the OpenBB Terminal, run this command from the home menu: `exe routines/comparison_demo.openbb` diff --git a/website/content/terminal/stocks/dark_pool_shorts/_index.md b/website/content/terminal/stocks/dark_pool_shorts/_index.md index 093e02e215d..130eeb3858d 100755 --- a/website/content/terminal/stocks/dark_pool_shorts/_index.md +++ b/website/content/terminal/stocks/dark_pool_shorts/_index.md @@ -1,5 +1,148 @@ --- +title: Introduction to Dark Pools & Short Data +keywords: "darkpools, dps, dark, pools, dp, short, shorts, naked, selling, sales, SEC, disclosure, ATS, OTC, OTCE, NMS, borrowed, shorted, ftd, fails-to-deliver, volume" +date: "05-30-2022" +type: guides +status: publish +excerpt: "The Introduction to Dark Pools & Short Data, within the Stocks menu, which explains how to use the menu and +provides a brief explanation of the features." geekdocCollapseSection: true --- +Dark Pools and short selling are both, controversial and mysterious, subjects. The lack of disclosure for short sales and dark pool trades makes a lot of guess-work. It is a good idea to read through some research on the topic available from the SEC: + - Alternative Trading Systems: Description of ATS Trading in National Market System Stocks + - Shedding Light on Dark Pools + - Staff Papers and Analyses -{{< toc-tree >}} +The purpose of this menu is to provide the user with tools for gauging the level of short interest, FTD rate, and off-exchange volume in a NMS security. +There are also commands for looking at market as a whole. Enter the submenu from the Stocks menu by typing, `dps`, and hitting `ENTER` (⏎). + +The Dark Pools Menu + +To use every feature in the Dark Pools menu, an API key for Quandl must be obtained (for free) and authorized on the local installation. See the Getting Started Guide for help setting up the API keys in the OpenBB Terminal. The four commands at the bottom of the menu rely on a loaded ticker while the six above do not. + +## How to use + +The commands which are not ticker-specific provide screener-like utility. A list of the most-shorted stocks, according to Yahoo Finance, is displayed with the `shorted` command. It should be noted that this menu is only able to provide data for SEC-regulated equities. + +shorted command output + +`hsi` is another source for the same list. There will be slight variations between the two. + +hsi command output + +`prom` performs a linear regression to scan for tickers with growing trade activity on ATS tapes, reported to FINRA. + +```` +(πŸ¦‹) /stocks/dps/ $ prom -n 50 -l 5 -t T1 +Processing Tier T1 ... +Processing regression on 50 promising tickers ... +```` + +Growing ATS Tier 1 NMS Trading Activity + +Tier 2 NMS Tickers: +```` +(πŸ¦‹) /stocks/dps/ $ prom -n 50 -l 5 -t T2 +Processing Tier T2 ... +Processing regression on 50 promising tickers ... +```` + +Growing ATS Tier 2 NMS Trading Activity + +Tier 3 OTCE Tickers: +```` +(πŸ¦‹) /stocks/dps/ $ prom -n 50 -l 5 -t OTCE +Processing Tier OTCE ... +Processing regression on 50 promising tickers ... +```` + +Growing ATS OTCE NMS Trading Activity + +`pos` provides a summary for the last reported trading day (information is updated in the early evening). Position represents a rolling twenty-day total and directional trends can be identified by watching the changes over time. Adding the `-a` flag will sort the list from the bottom up - the most negative - and creates a fuller picture when watching in tandom with the positive side of the ledger. Monitor the rate of change in position sizes, or a reversal in directional flow. This white paper, written by SqueezeMetrics, sheds some light on the trading activity reported here. + +```` +(πŸ¦‹) /stocks/dps/ $ pos -l 25 +```` + +Top 25 Dark Pool Positions + +The other end of the spectrum: + +```` +(πŸ¦‹) /stocks/dps/ $ pos -l 25 -a +```` + +Top 25 Dark Pool Positions + +Call on the help dialogue for every command by attaching, `-h` to the command. The optional arguments give the user flexibility to sort the columns, print the raw data, or export to a file. + +## Examples + +The cost-to-borrow is used as a proxy-measurement for an equity's specialness. `ctb` shows the most expensive equities to short, and the number shares available to short, on Interactive Brokers. + +```` +(πŸ¦‹) /stocks/dps/ $ ctb +```` + + +ctb + +How many tickers have a borrow rate above 100%? Set the limit to a high number and export the data to a spreadsheet. + +```` +(πŸ¦‹) /stocks/dps/ $ ctb -n 5000 --export xlsx + +Saved file: /exports/20220530_130058_stocks_dark_pool_shorts_cost_to_borrow.xlsx +```` + +As of writing, there are 158 securities with a cost-to-borrow rate above 100%. + +ctb2 + +Cross reference that list with the `sidtc` command. Days-to-cover is the approximate number of days it would take to cover those shorts if the amount and proportion of volume were to remain constant. Use the optional arguments to sort the columns. + +sidtc + +Load AAPL and request a 1-year chart of the net short volume and position. This provides the individual ticker data corresponding with the `pos` command. + +```` +(πŸ¦‹) /stocks/dps/ $ load AAPL + +Loading Daily AAPL stock with starting period 2019-05-28 for analysis. + +Datetime: 2022 May 30 14:59 +Timezone: America/New_York +Currency: USD +Market: CLOSED +Company: Apple Inc. + +(πŸ¦‹) /stocks/dps/ $ spos +```` + +spos + +Prolonged periods where the net short volume is above 50% are notable. + +```` +(πŸ¦‹) /stocks/dps/ $ psi +```` + +spos + +See the aggregate sum total of fail-to-delivers, with the historical price, with the `ftd` command. + +```` +(πŸ¦‹) /stocks/dps/ $ ftd -s 2020-05-30 +```` + +ftd + +The data from `dpotc`, statistics for individual NMS tickers, shows weekly OTC and ATS trade volume with the average lot size, which is reported on a lagging schedule. + +```` +(πŸ¦‹) /stocks/dps/ $ dpotc +```` + +dpotc + +Run a live demo of these features by entering `exe routines/darkpool_demo.openbb` into the Terminal from the home screen. diff --git a/website/content/terminal/stocks/discovery/_index.md b/website/content/terminal/stocks/discovery/_index.md index 3205579ca50..9024b338db9 100755 --- a/website/content/terminal/stocks/discovery/_index.md +++ b/website/content/terminal/stocks/discovery/_index.md @@ -1,8 +1,50 @@ --- +title: Introduction to Stocks Discovery +keywords: "stocks, discovery, disc, menu, submenu, pipo, fipo, gainers, losers, ugs, gtech, active, ulc, asc, ford, arkord, upcoming, trending, cnews, lowfloat, hotpenny, rtat, divcal, dividends, short, trending, news" +date: "2022-05-30" +type: guides +status: publish +excerpt: "Introducing the Discovery menu, within the Stocks menu. This guide will empower the user to get the most +out of this set of features." geekdocCollapseSection: true --- +The set of features within the Stocks Discovery submenu provides tools for discovering trade setups, for following trends, and for staying up with current events. Enter the menu from the stocks menu by typing, `disc`, and pressing, `ENTER` (⏎). Absolute path jumping is possible from anywhere, to anywhere. For example, jumping from the Portfolio Optimization submenu to the Stocks Discovery submenu: -Use the 'disc' command to navigate to the Discovery Submenu -Feature Screenshot - Disc +Absolute path jumping to the Stocks Discovery submenu -{{< toc-tree >}} +To use all commands in the Discovery menu, the following (free) API keys are required: + - Quandl + - Finnhub + +See the Getting Started Guide for setting API keys in the OpenBB Terminal. + +## How to use + +The help dialogue, for any command, is displayed by attaching, `-h`, to the string; i.e., `divcal -h`. This menu will +be one of the easiest to get comfortable with a command-line interface. All outputs from commands in this +menu are text and tables. There are no charts or images generated. Exports, where available, can be formatted as +csv, json, or xlsx files. Watch this short demonstration of all features in this menu: + +Discovery Menu Demonstration Video + +## Examples + +The dividend calendar can show any single date. + +```` +(πŸ¦‹) /stocks/disc/ $ divcal -d 2022-06-02 -l 25 +```` + +The 25 biggest dividend payments with an ex-div date of June 2, 2022 + +See Cathie Wood's trades and sort by different fields such as Fund, weighting, buy-only, or sell-only. + +Cathie Wood's trades + +Check the upcoming earnings schedule using, `upcoming`: + +Upcoming earnings calendar + +Browse the news by category from Seeking Alpha with `cnews`: + +News headlines by category diff --git a/website/content/terminal/stocks/discovery/discovery_demo.gif b/website/content/terminal/stocks/discovery/discovery_demo.gif new file mode 100644 index 00000000000..41b02c9b264 Binary files /dev/null and b/website/content/terminal/stocks/discovery/discovery_demo.gif differ diff --git a/website/data/menu/main.yml b/website/data/menu/main.yml index fbb14490a0d..d890e536e7f 100755 --- a/website/data/menu/main.yml +++ b/website/data/menu/main.yml @@ -243,7 +243,8 @@ main: ref: "/terminal/stocks/fundamental_analysis/cal" - name: splits ref: "/terminal/stocks/fundamental_analysis/splits" - - name: fundamental_analysis/web" + - name: web + ref: "/terminal/stocks/fundamental_analysis/web" - name: hq ref: "/terminal/stocks/fundamental_analysis/hq" - name: divs