okama.AssetList.get_cumulative_return

AssetList.get_cumulative_return(period=None, real=False)

Calculate cumulative return over a given trailing period for each asset.

The cumulative return is the total change in the asset price during the investment period.

Inflation adjusted cumulative returns (real cumulative returns) are shown with real=True option. Annual inflation data is calculated for the same period if inflation=True in the AssetList.

Parameters:
period: str, int or None, default None

Trailing period in years. Period should be more then 0. None - full time cumulative return. ‘YTD’ - (Year To Date) period of time beginning the first day of the calendar year up to the last month.

real: bool, default False

Cumulative return is adjusted for inflation (real cumulative return) if True. AssetList should be initiated with Inflation=True for real cumulative return.

Returns:
Series

Cumulative return values for each asset and cumulative inflation (if inflation=True in AssetList).

See also

get_rolling_cagr

Calculate rolling CAGR.

get_cagr

Calculate CAGR.

get_rolling_cumulative_return

Calculate rolling cumulative return.

annual_return

Calculate annualized mean return (arithmetic mean).

Examples

>>> x = ok.AssetList(['MCFTR.INDX'], ccy='RUB')
>>> x.get_cumulative_return(period='YTD')
MCFTR.INDX   0.1483
RUB.INFL     0.0485
dtype: float64