Skip to main content

yret

Get yearly returns

Source Code: [link]

openbb.portfolio.yret(portfolio_engine: portfolio_engine.PortfolioEngine, window: str = "all")

Parameters

NameTypeDescriptionDefaultOptional
portfolio_enginePortfolioEnginePortfolioEngine class instance, this will hold transactions and perform calculations.
Use portfolio.load to create a PortfolioEngine.
NoneFalse
windowstrinterval to compare cumulative returns and benchmarkallTrue

Returns

TypeDescription
pd.DataFrameDataFrame with yearly returns

Examples

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