basket¶
-
basket
(series, weights, costs=None, rebal_freq=<RebalFreq.DAILY: 'daily'>, return_type=<ReturnType.EXCESS_RETURN: 'excess_return'>)[source]¶ Calculates a basket return series.
- Parameters
series (
list
) – list of time series of instrumentsweights (
list
) – list of weightscosts (
Optional
[list
]) – list of costs; defaults to costs of 0rebal_freq (
RebalFreq
) – rebalancing frequency - Daily or Monthlyreturn_type (
ReturnType
) – return type of underlying instruments - excess return supported only.
- Return type
Series
- Returns
time-series of the resulting basket
Usage
Calculates a basket return series.
Examples
Generate price series and combine them in a basket
>>> prices1 = generate_series(100) >>> prices2 = generate_series(100) >>> mybasket = basket([prices1, prices2], [0.5, 0.5])
See also
prices()