summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChavithra PARANA <chavithra@gmail.com>2022-11-28 15:52:27 +0100
committerChavithra PARANA <chavithra@gmail.com>2022-11-28 15:52:27 +0100
commit69cb64d24f937911dde7b245a23faa3458decd82 (patch)
tree9a44491df79af198e143c55b96fd3c02da7e8f54
parentcb09e40b699a824bea1a72762db4b73fa632788d (diff)
parentb1f3dc1bf143c1280e40ec36ce9c877977d0c454 (diff)
Merge branch 'main' of github.com:OpenBB-finance/OpenBBTerminal
-rw-r--r--openbb_terminal/forecast/brnn_view.py2
-rw-r--r--openbb_terminal/forecast/forecast_controller.py6
-rw-r--r--openbb_terminal/forecast/nhits_model.py2
-rw-r--r--openbb_terminal/forecast/nhits_view.py2
-rw-r--r--openbb_terminal/forecast/tcn_model.py7
-rw-r--r--openbb_terminal/forecast/tcn_view.py6
-rw-r--r--openbb_terminal/forecast/trans_model.py3
-rw-r--r--openbb_terminal/forecast/trans_view.py6
-rw-r--r--openbb_terminal/stocks/comparison_analysis/ca_controller.py6
-rw-r--r--openbb_terminal/stocks/screener/finviz_view.py3
-rw-r--r--openbb_terminal/stocks/screener/screener_controller.py39
-rw-r--r--openbb_terminal/stocks/screener/yahoofinance_model.py9
-rw-r--r--tests/openbb_terminal/stocks/comparison_analysis/test_ca_controller.py3
-rw-r--r--tests/openbb_terminal/stocks/screener/txt/test_screener_controller/test_print_help.txt2
-rw-r--r--website/content/sdk/guides/intros/portfolio/index.md363
-rw-r--r--website/content/sdk/guides/intros/stocks/dark-pool-shorts.md218
-rw-r--r--website/content/terminal/quickstart/faq.md49
-rw-r--r--website/content/terminal/reference/forecast/nhits.md6
18 files changed, 548 insertions, 184 deletions
diff --git a/openbb_terminal/forecast/brnn_view.py b/openbb_terminal/forecast/brnn_view.py
index 21daa9a80ae..cff4d7fd05a 100644
--- a/openbb_terminal/forecast/brnn_view.py
+++ b/openbb_terminal/forecast/brnn_view.py
@@ -33,7 +33,7 @@ def display_brnn_forecast(
batch_size: int = 32,
n_epochs: int = 100,
learning_rate: float = 1e-3,
- model_save_name: str = "rnn_model",
+ model_save_name: str = "brnn_model",
force_reset: bool = True,
save_checkpoints: bool = True,
export: str = "",
diff --git a/openbb_terminal/forecast/forecast_controller.py b/openbb_terminal/forecast/forecast_controller.py
index 448ebec0f06..cf183430c60 100644
--- a/openbb_terminal/forecast/forecast_controller.py
+++ b/openbb_terminal/forecast/forecast_controller.py
@@ -3032,7 +3032,7 @@ class ForecastController(BaseController):
"--layer_widths",
dest="layer_widths",
type=check_positive,
- default=3,
+ default=512,
help="The number of neurons in each layer",
)
parser.add_argument(
@@ -3056,7 +3056,7 @@ class ForecastController(BaseController):
"--max_pool_1d",
action="store_true",
dest="maxpool1d",
- default=False,
+ default=True,
help="Whether to use max_pool_1d or AvgPool1d",
)
if other_args and "-" not in other_args[0][0]:
@@ -3068,7 +3068,7 @@ class ForecastController(BaseController):
target_dataset=True,
n_days=True,
force_reset=True,
- model_save_name="tft_model",
+ model_save_name="nhits_model",
train_split=True,
dropout=0.1,
input_chunk_length=True,
diff --git a/openbb_terminal/forecast/nhits_model.py b/openbb_terminal/forecast/nhits_model.py
index 84786465c55..8b3fa948832 100644
--- a/openbb_terminal/forecast/nhits_model.py
+++ b/openbb_terminal/forecast/nhits_model.py
@@ -40,7 +40,7 @@ def get_nhits_data(
batch_size: int = 32,
n_epochs: int = 100,
learning_rate: float = 1e-3,
- model_save_name: str = "brnn_model",
+ model_save_name: str = "nhits_model",
force_reset: bool = True,
save_checkpoints: bool = True,
) -> Tuple[
diff --git a/openbb_terminal/forecast/nhits_view.py b/openbb_terminal/forecast/nhits_view.py
index d0c82250e6f..caf2f07bd98 100644
--- a/openbb_terminal/forecast/nhits_view.py
+++ b/openbb_terminal/forecast/nhits_view.py
@@ -39,7 +39,7 @@ def display_nhits_forecast(
batch_size: int = 32,
n_epochs: int = 100,
learning_rate: float = 1e-3,
- model_save_name: str = "rnn_model",
+ model_save_name: str = "nhits_model",
force_reset: bool = True,
save_checkpoints: bool = True,
export: str = "",
diff --git a/openbb_terminal/forecast/tcn_model.py b/openbb_terminal/forecast/tcn_model.py
index ef1534aea49..9c0de7d2dbe 100644
--- a/openbb_terminal/forecast/tcn_model.py
+++ b/openbb_terminal/forecast/tcn_model.py
@@ -27,12 +27,12 @@ def get_tcn_data(
input_chunk_length: int = 14,
output_chunk_length: int = 5,
dropout: float = 0.1,
- num_filters: int = 6,
+ num_filters: int = 3,
weight_norm: bool = True,
dilation_base: int = 2,
- n_epochs: int = 100,
+ n_epochs: int = 300,
learning_rate: float = 1e-3,
- batch_size: int = 800,
+ batch_size: int = 32,
model_save_name: str = "tcn_model",
force_reset: bool = True,
save_checkpoints: bool = True,
@@ -95,7 +95,6 @@ def get_tcn_data(
Mean average precision error,
Best TCN Model.
"""
-
# TODO Check if torch GPU AVAILABLE
use_scalers = True
diff --git a/openbb_terminal/forecast/tcn_view.py b/openbb_terminal/forecast/tcn_view.py
index 8b93028df33..793f35246ce 100644
--- a/openbb_terminal/forecast/tcn_view.py
+++ b/openbb_terminal/forecast/tcn_view.py
@@ -28,12 +28,12 @@ def display_tcn_forecast(
input_chunk_length: int = 14,
output_chunk_length: int = 5,
dropout: float = 0.1,
- num_filters: int = 6,
+ num_filters: int = 3,
weight_norm: bool = True,
dilation_base: int = 2,
- n_epochs: int = 100,
+ n_epochs: int = 300,
learning_rate: float = 1e-3,
- batch_size: int = 800,
+ batch_size: int = 32,
model_save_name: str = "tcn_model",
force_reset: bool = True,
save_checkpoints: bool = True,
diff --git a/openbb_terminal/forecast/trans_model.py b/openbb_terminal/forecast/trans_model.py
index ebdd621ae3a..dc94111571e 100644
--- a/openbb_terminal/forecast/trans_model.py
+++ b/openbb_terminal/forecast/trans_model.py
@@ -34,7 +34,7 @@ def get_trans_data(
activation: str = "relu",
dropout: float = 0.0,
batch_size: int = 32,
- n_epochs: int = 100,
+ n_epochs: int = 300,
learning_rate: float = 1e-3,
model_save_name: str = "trans_model",
force_reset: bool = True,
@@ -103,7 +103,6 @@ def get_trans_data(
Mean average precision error,
Best transformer Model.
"""
-
# TODO Check if torch GPU AVAILABLE
use_scalers = True
diff --git a/openbb_terminal/forecast/trans_view.py b/openbb_terminal/forecast/trans_view.py
index f59c615f8c7..5fde027f746 100644
--- a/openbb_terminal/forecast/trans_view.py
+++ b/openbb_terminal/forecast/trans_view.py
@@ -33,9 +33,9 @@ def display_trans_forecast(
num_decoder_layers: int = 3,
dim_feedforward: int = 512,
activation: str = "relu",
- dropout: float = 0.1,
- batch_size: int = 16,
- n_epochs: int = 100,
+ dropout: float = 0.0,
+ batch_size: int = 32,
+ n_epochs: int = 300,
learning_rate: float = 1e-3,
model_save_name: str = "trans_model",
force_reset: bool = True,
diff --git a/openbb_terminal/stocks/comparison_analysis/ca_controller.py b/openbb_terminal/stocks/comparison_analysis/ca_controller.py
index 0ec2ee52c79..4e431da962a 100644
--- a/openbb_terminal/stocks/comparison_analysis/ca_controller.py
+++ b/openbb_terminal/stocks/comparison_analysis/ca_controller.py
@@ -92,6 +92,12 @@ class ComparisonAnalysisController(BaseController):
self.completer = NestedCompleter.from_nested_dict(choices)
+ def call_exit(self, _) -> None:
+ """Process exit terminal command from forecast menu."""
+ self.save_class()
+ for _ in range(self.PATH.count("/") + 1):
+ self.queue.insert(0, "quit")
+
def print_help(self):
"""Print help"""
mt = MenuText("stocks/ca/", 80)
diff --git a/openbb_terminal/stocks/screener/finviz_view.py b/openbb_terminal/stocks/screener/finviz_view.py
index 229607979b9..feb16fd9ade 100644
--- a/openbb_terminal/stocks/screener/finviz_view.py
+++ b/openbb_terminal/stocks/screener/finviz_view.py
@@ -250,4 +250,7 @@ def screener(
return list(df_screen.head(n=limit)["Ticker"].values)
+ console.print(
+ "The preset selected did not return a sufficient number of tickers. Two or more tickers are needed."
+ )
return []
diff --git a/openbb_terminal/stocks/screener/screener_controller.py b/openbb_terminal/stocks/screener/screener_controller.py
index 56a3da7e9ee..83adec0a975 100644
--- a/openbb_terminal/stocks/screener/screener_controller.py
+++ b/openbb_terminal/stocks/screener/screener_controller.py
@@ -78,7 +78,7 @@ class ScreenerController(BaseController):
"""Constructor"""
super().__init__(queue)
- self.preset = "top_gainers"
+ self.preset = "top_gainers.ini"
self.screen_tickers: List = list()
if session and obbff.USE_PROMPT_TOOLKIT:
@@ -228,8 +228,12 @@ class ScreenerController(BaseController):
parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES
)
if ns_parser:
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
self.screen_tickers = yahoofinance_view.historical(
- self.preset,
+ preset,
ns_parser.limit,
ns_parser.start,
ns_parser.type_candle,
@@ -370,9 +374,13 @@ class ScreenerController(BaseController):
)
if ns_parser:
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
sort_map = screener_helper.finviz_map("valuation")
self.screen_tickers = finviz_view.screener(
- loaded_preset=self.preset,
+ loaded_preset=preset,
data_type="valuation",
limit=ns_parser.limit,
ascend=ns_parser.reverse,
@@ -439,9 +447,13 @@ class ScreenerController(BaseController):
)
if ns_parser:
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
sort_map = screener_helper.finviz_map("financial")
self.screen_tickers = finviz_view.screener(
- loaded_preset=self.preset,
+ loaded_preset=preset,
data_type="financial",
limit=ns_parser.limit,
ascend=ns_parser.reverse,
@@ -508,10 +520,13 @@ class ScreenerController(BaseController):
)
if ns_parser:
-
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
sort_map = screener_helper.finviz_map("ownership")
self.screen_tickers = finviz_view.screener(
- loaded_preset=self.preset,
+ loaded_preset=preset,
data_type="ownership",
limit=ns_parser.limit,
ascend=ns_parser.reverse,
@@ -579,8 +594,12 @@ class ScreenerController(BaseController):
sort_map = screener_helper.finviz_map("performance")
if ns_parser:
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
self.screen_tickers = finviz_view.screener(
- loaded_preset=self.preset,
+ loaded_preset=preset,
data_type="performance",
limit=ns_parser.limit,
ascend=ns_parser.reverse,
@@ -646,9 +665,13 @@ class ScreenerController(BaseController):
)
if ns_parser:
+ if self.preset.strip(".ini") in finviz_model.d_signals:
+ preset = self.preset.strip(".ini")
+ else:
+ preset = self.preset
sort_map = screener_helper.finviz_map("technical")
self.screen_tickers = finviz_view.screener(
- loaded_preset=self.preset,
+ loaded_preset=preset,
data_type="technical",
limit=ns_parser.limit,
ascend=ns_parser.reverse,
diff --git a/openbb_terminal/stocks/screener/yahoofinance_model.py b/openbb_terminal/stocks/screener/yahoofinance_model.py
index ba2551e0fbc..a00c24d9694 100644
--- a/openbb_terminal/stocks/screener/yahoofinance_model.py
+++ b/openbb_terminal/stocks/screener/yahoofinance_model.py
@@ -115,7 +115,9 @@ def historical(
if l_stocks:
if len(l_stocks) < 2:
- console.print("Please select two or more tickers.\n")
+ console.print(
+ "The preset selected did not return a sufficient number of tickers. Two or more tickers are needed."
+ )
return pd.DataFrame(), [], False
if len(l_stocks) > limit:
random.shuffle(l_stocks)
@@ -150,5 +152,10 @@ def historical(
columns=final_screener.columns,
index=final_screener.index,
)
+ else:
+ console.print(
+ "The preset selected did not return a sufficient number of tickers. Two or more tickers are needed."
+ )
+ return pd.DataFrame(), [], False
return final_screener, l_stocks, limit_random_stocks
diff --git a/tests/openbb_terminal/stocks/comparison_analysis/test_ca_controller.py b/tests/openbb_terminal/stocks/comparison_analysis/test_ca_controller.py
index 2d26b3bdc01..0c8b612d921 100644
--- a/tests/openbb_terminal/stocks/comparison_analysis/test_ca_controller.py
+++ b/tests/openbb_terminal/stocks/comparison_analysis/test_ca_controller.py
@@ -170,9 +170,10 @@ def test_call_cls(mocker):
"quit",
"quit",
"quit",
+ "quit",
],
),
- ("call_exit", ["help"], ["quit", "quit", "quit", "help"]),
+ ("call_exit", ["help"], ["quit", "quit", "quit", "quit", "help"]),
("call_home", [], ["quit", "quit"]),
("call_help", [], []),
("call_quit", [], ["quit"]),
diff --git a/tests/openbb_terminal/stocks/screener/txt/test_screener_controller/test_print_help.txt b/tests/openbb_terminal/stocks/screener/txt/test_screener_controller/test_print_help.txt
index f7eb89c83ac..e5f50122d35 100644
--- a/tests/openbb_terminal/stocks/screener/txt/test_screener_controller/test_print_help.txt
+++ b/tests/openbb_terminal/stocks/screener/txt/test_screener_controller/test_print_help.txt
@@ -1,7 +1,7 @@
view view available presets (defaults and customs)
set set one of the available presets
-Preset: top_gainers
+Preset: top_gainers.ini
historical view historical price [YahooFinance]
overview overview (e.g. Sector, Industry, Market Cap, Volume) [Finviz]
diff --git a/website/content/sdk/guides/intros/portfolio/index.md b/website/content/sdk/guides/intros/portfolio/index.md
index 1d1d450d43f..e987fe657d0 100644
--- a/website/content/sdk/guides/intros/portfolio/index.md
+++ b/website/content/sdk/guides/intros/portfolio/index.md
@@ -1,217 +1,284 @@
---
title: Portfolio
-keywords: ["portfolio", "attribution", "optimization", "pnl", "benchmark", "return", "volatility", "metrics", "broker", "integration", "report"]
-excerpt: "The Introduction to Portfolio explains how to use the
-menu and provides a brief description of its sub-menus"
-
---
-The capabilities of the [Portfolio menu](/terminal/guides/portfolio) from the OpenBB Terminal are wrapped into a powerful SDK, enabling users to work with the data in a flexible environment that can be fully customized to meet the needs of any user. This menu is dedicated to properly explaining and optimizing your own portfolio with features to load your own orderbook (transactions) it is possible to compare your results to that of a <a href="https://www.investopedia.com/terms/b/benchmark.asp" target="_blank" rel="noreferrer noopener">benchmark</a>. For example, you are able to load both your portfolio and a benchmark, then have the option to look into the performance compared to the benchmark asking the question "_What if I invested all my money in the benchmark instead?_" as well as see a wide variety of statistics and metrics. Next to that, with these findings you can apply optimization techniques to your portfolio through functionalities which can be found in the `openbb.portfolio.po` sub-module.
-
-## How to use
-
-Start a Python script or Notebook file by importing the module:
+The [Portfolio menu](/terminal/guides/intros/portfolio), from the OpenBB Terminal, is wrapped into a Python SDK layer, enabling users to programmatically work with the data in a flexible environment, fully customizable for the needs of any user. This guide will introduce the functions within the main Portfolio module, and walk through examples demonstrating how to work with a portfolio file and object.
-```python
-from openbb_terminal.sdk import openbb
-```
+## How to Use
Below is a brief description of each function within the Portfolio module:
| Path | Type | Description |
| :------------------------- | :--------: | -------------------------------------------: |
-| openbb.portfolio.summary | Function | Portfolio and benchmark returns summary |
+| openbb.portfolio.alloc | Sub-Module | Allocation Metrics Compared to the Benchmark |
+| openbb.portfolio.bench | Function | Select a Benchmark for the Portfolio |
+| openbb.portfolio.distr | Function | Distribution of Daily Returns |
+| openbb.portfolio.dret | Function | Daily Returns |
+| openbb.portfolio.es | Function | Expected Shortfall |
+| openbb.portfolio.holdp | Function | Holdings of Assets as a % |
+| openbb.portfolio.holdv | Function | Holdings of Assets as an Absolute Value |
+| openbb.portfolio.load | Function | Load a Portfolio File |
+| openbb.portfolio.maxdd | Function | Maximum Drawdown |
+| openbb.portfolio.metric | Sub-Module | Risk and Portfolio Metrics |
+| openbb.portfolio.mret | Function | Monthly Returns |
+| openbb.portfolio.om | Function | Omega Ratio |
+| openbb.portfolio.perf | Function | Portfolio Performance vs Benchmark |
| openbb.portfolio.po | Sub-Module | Portfolio Optimization Sub Menu |
-| openbb.portfolio.dret | Function | Get daily returns |
-| openbb.portfolio.holdp | Function | Get holdings of assets in % |
-| openbb.portfolio.yret | Function | Get yearly returns |
-| openbb.portfolio.rbeta | Function | Rolling beta using portfolio and benchmark returns |
-| openbb.portfolio.rsharpe | Function | Rolling sharpe ratio |
-| openbb.portfolio.distr | Function | Distribution of daily returns |
-| openbb.portfolio.om | Function | Omega ratio |
-| openbb.portfolio.es | Function | Expected shortfall |
-| openbb.portfolio.perf | Function | Portfolio performance vs the benchmark |
-| openbb.portfolio.rsort | Function | Rolling sortino |
-| openbb.portfolio.bench | Function | Load benchmark into portfolio |
-| openbb.portfolio.metric | Sub-Module | Metric functions you can apply |
-| openbb.portfolio.alloc | Function | Region allocation compared to the benchmark |
-| openbb.portfolio.rvol | Function | Rolling volatility |
-| openbb.portfolio.var | Function | Get portfolio VaR |
-| openbb.portfolio.load | Function | Load portfolio using a file |
-| openbb.portfolio.show | Function | Get portfolio transactions |
-| openbb.portfolio.mret | Function | Get monthly returns |
-| openbb.portfolio.holdv | Function | Get holdings of assets (absolute value) |
-
-Alteratively you can print the contents of the Porfolio SDK with:
+| openbb.portfolio.rbeta | Function | Rolling Beta of Portfolio and Benchmark Returns |
+| openbb.portfolio.rsharpe | Function | Rolling Sharpe Ratio |
+| openbb.portfolio.rsort | Function | Rolling Sortino Ratio |
+| openbb.portfolio.rvol | Function | Rolling Volatility |
+| openbb.portfolio.show | Function | Portfolio Transactions |
+| openbb.portfolio.summary | Function | Summary of Portfolio and Benchmark Returns |
+| openbb.portfolio.var | Function | Portfolio VaR |
+| openbb.portfolio.yret | Function | Yearly Returns |
+
+Alteratively, the contents of the Porfolio module is printed with:
```python
help(openbb.portfolio)
```
+Many of the functions in this module will also have a companion command, `_chart`.
+
+### Portfolio Files
+
+Portfolio files are spreadsheets (xlsx or csv files) containing historical trades which add up to represent a net balance in the Portfolio Engine. Users should keep their collection of holdings files in the OpenBBUserData folder, `~/OpenBBUserData/portfolio/holdings`. They are shared resources with the CLI Terminal, and sample files are included within the installation folder. See the [source code](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/miscellaneous/portfolio_examples/holdings) on GitHub to view and download them directly. We recommend using the example files as a template when creating a new portfolio because of specific formatting requirements. The table below illustrates the required column titles:
+
+| Date | Type | Ticker | Side | Price | Quantity | Fees | Investment | Currency | Sector | Industry | Country | Region |
+|:-----------|:-------|:---------|:-------|--------:|-----------:|-------:|-------------:|:-----------|:-----------------------|:-------------------------------|:--------------|:--------------|
+| 2021-10-29 | STOCK | K.TO | Buy | 7.93 | 190 | 20 | 1526.7 | CAD | Basic Materials | Gold | Canada | North America |
+| 2015-01-02 | ETF | SPY | Buy | 178.28 | 5.6 | 0 | 998.368 | USD | - | - | - | - |
+| 2015-01-01 | CRYPTO | BTC-USD | Buy | 1000 | 2 | 0 | 2000 | USD | Crypto | Crypto | Crypto | Crypto |
+| 2011-01-03 | STOCK | AMZN | Buy | 9.22 | 100 | 0 | 922 | USD | Consumer Cyclical | Internet Retail | United States | North America |
+| 2011-01-03 | STOCK | AAPL | Buy | 11.74 | 100 | 0 | 1174 | USD | Technology | Consumer Electronics | United States | North America |
+| 2011-01-03 | STOCK | MSFT | Buy | 28.04 | 100 | 0 | 2804 | USD | Technology | Software-Infrastructure | United States | North America |
+| 2011-01-03 | STOCK | TSLA | Buy | 1.76 | 100 | 0 | 176 | USD | Consumer Cyclical | Auto Manufacturers | United States | North America |
+| 2011-01-03 | STOCK | GOOG | Buy | 15.01 | 100 | 0 | 1501 | USD | Communication Services | Internet Content & Information | United States | North America |
+
+Not every column needs to contain a value, but they must exist despite being empty. The accepted values for `Type` are currently:
+
+- Crypto
+- ETF
+- Stock
+- More Coming Soon!
+
+The table above is supplied here as a portfolio XLSX file - [example.xlsx](https://github.com/OpenBB-finance/OpenBBTerminal/files/10096861/example.xlsx) - save the file in the OpenBBUserData folder, `~/OpenBBUserData/portfolio/holdings/`
+
+Categorization will be done automatically where the information is not supplied. To manually set the asset categorization (region, sector, industry, country), use the template file, `Public_Equity_Orderbook.xlsx`.
+
## Examples
-### Loading a Portfolio
+The examples in this guide will assume that the import statements below are included at the top of the Python script or Jupyter Notebook.
-The first step in using this menu is loading a portfolio. Here, we provide an
-example titled "Public_Equity_Orderbook.xlsx" which can be loaded in. This file
-also serves as a template when you wish to fill in your own orders. This results
-in the following:
+### Import Statements
```python
-from openbb_terminal.sdk import Portfolio
+from openbb_terminal.sdk import openbb
+import pandas as pd
+# %matplotlib inline (uncomment if using a Jupyter Notebook or an Interactive Window)
+```
-# Define your own orderbook location here
-orderbook_path = "Public_Equity_Orderbook.xlsx"
+### Load
-# Load in the transactions
-transactions = Portfolio.read_orderbook(orderbook_path)
-P = Portfolio(transactions)
-P.generate_portfolio_data()
+Taking the downloaded `example.xlsx` file from the previous section, let's load it into the Portfolio Engine. There are a few parameters available for this function, and an object is returned.
-# Load in the benchmark, by default this is the SPY ETF
-P.load_benchmark()
+```python
+help(openbb.portfolio.load)
```
-### Excel Sheet Format
+```console
+ Get PortfolioEngine object
+
+ Parameters
+ ----------
+ transactions_file_path : str
+ Path to transactions file
+ benchmark_symbol : str
+ Benchmark ticker to download data
+ full_shares : bool
+ Whether to mimic the portfolio trades exactly (partial shares) or round down the
+ quantity to the nearest number
+ risk_free_rate : float
+ Risk free rate in float format
+
+ Returns
+ -------
+ Portfolio