Skip to main content

bench

Load benchmark into portfolio

Source Code: [link]

openbb.portfolio.bench(portfolio_engine: portfolio_engine.PortfolioEngine, symbol: str, full_shares: bool = False)

Parameters

NameTypeDescriptionDefaultOptional
portfolio_enginePortfolioEnginePortfolioEngine class instance, this will hold transactions and perform calculations.
Use portfolio.load to create a PortfolioEngine.
NoneFalse
symbolstrBenchmark symbol to download dataNoneFalse
full_sharesboolWhether to mimic the portfolio trades exactly (partial shares) or round down the
quantity to the nearest number
FalseTrue

Returns

This function does not return anything


Examples

from openbb_terminal.sdk import openbb
p = openbb.portfolio.load("openbb_terminal/miscellaneous/portfolio_examples/holdings/example.csv")
output = openbb.portfolio.bench(p, symbol="SPY")