Skip to main content

mret

Get monthly returns

Source Code: [link]

openbb.portfolio.mret(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 monthly returns

Examples

from openbb_terminal.sdk import openbb
p = openbb.portfolio.load("openbb_terminal/miscellaneous/portfolio/holdings_example.xlsx")
output = openbb.portfolio.mret(p)