get_aggregate_returns

qf_lib.common.utils.returns.get_aggregate_returns.get_aggregate_returns(series: QFSeries, convert_to: Frequency, multi_index: bool = False, keep_nans: bool = False) SimpleReturnsSeries[source]

Aggregates returns by week, month, or year. Note: The cumulative returns function replaces all Nans with 0.000.

Parameters:
  • series (QFSeries) – Daily returns of the strategy, noncumulative.

  • convert_to (Frequency) – Can be ‘weekly’, ‘monthly’, or ‘yearly’.

  • multi_index (bool) – Determines whether the grouping multi-index should be preserved.

Returns:

Aggregated returns.

Return type:

SimpleReturnsSeries