sigmaquant.performance.returns.aggregate_returns#

sigmaquant.performance.returns.aggregate_returns(returns, frequency='Y', kind='simple')#

Aggregate returns or PnL to a target frequency.

Parameters:
  • returns – Time series indexed by datetime.

  • frequency

    Target aggregation frequency:
    • ”D”: daily

    • ”W”: weekly

    • ”M”: monthly

    • ”Y”: yearly

  • kind ({"simple", "log", "pnl"}, optional) –

    • "simple": simple (decimal) returns, compounded

    • "log": log-returns, aggregated additively

    • "pnl": additive profit-and-loss values

Returns:

Aggregated time series.

Return type:

pandas.Series