aggregate_returns

qf_lib.common.utils.returns.custom_returns_aggregating.aggregate_returns(returns: qf_lib.containers.series.returns_series.ReturnsSeries, start_dates: Sequence[datetime.datetime], end_dates: Sequence[datetime.datetime]) → Sequence[float][source]

Aggregates returns using custom start dates and end dates.

Parameters
  • returns (ReturnsSeries) – returns to be aggregated

  • start_dates (Sequence[datetime]) – list of start dates for aggregations

  • end_dates (Sequence[datetime]) – list of end dates for aggregations (of the same length as start_dates)

Returns

list of aggregated returns corresponding to given start dates and end dates (it has the same length)

Return type

Sequence[float]