Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

#
accessors module

Custom Pandas accessors for returns.

Methods can be accessed as follows:

- ReturnsSRAccessor -> `pd.Series.vbt.returns.*`
- ReturnsDFAccessor -> `pd.DataFrame.vbt.returns.*`

Note

The underlying Series/DataFrame must already be a return series. To convert price to returns, use ReturnsAccessor.from_value().

Grouping is only supported by the methods that accept the `group_by` argument.

Accessors do not utilize caching.

There are three options to compute returns and get the accessor:

    >>> from vectorbtpro import *

    >>> price = pd.Series([1.1, 1.2, 1.3, 1.2, 1.1])

    >>> # 1. pd.Series.pct_change
    >>> rets = price.pct_change()
    >>> ret_acc = rets.vbt.returns(freq='d')

    >>> # 2. vectorbtpro.generic.accessors.GenericAccessor.to_returns
    >>> rets = price.vbt.to_returns()
    >>> ret_acc = rets.vbt.returns(freq='d')

    >>> # 3. vectorbtpro.returns.accessors.ReturnsAccessor.from_value
    >>> ret_acc = pd.Series.vbt.returns.from_value(price, freq='d')

    >>> # vectorbtpro.returns.accessors.ReturnsAccessor.total
    >>> ret_acc.total()
    0.0

The accessors extend vectorbtpro.generic.accessors.

    >>> # inherited from GenericAccessor
    >>> ret_acc.max()
    0.09090909090909083

## Defaults

ReturnsAccessor accepts `defaults` dictionary where you can pass defaults for arguments used throughout the accessor, such as

- `start_value`: The starting value.
- `window`: Window length.
- `minp`: Minimum number of observations in a window required to have a value.
- `ddof`: Delta Degrees of Freedom.
- `risk_free`: Constant risk-free return throughout the period.
- `levy_alpha`: Scaling relation (Levy stability exponent).
- `required_return`: Minimum acceptance return of the investor.
- `cutoff`: Decimal representing the percentage cutoff for the bottom percentile of returns.

Defaults as well as `bm_returns` and `year_freq` can be set globally using settings:

    >>> benchmark = pd.Series([1.05, 1.1, 1.15, 1.1, 1.05])
    >>> bm_returns = benchmark.vbt.to_returns()

    >>> vbt.settings.returns['bm_returns'] = bm_returns

## Stats

Hint

See StatsBuilderMixin.stats() and ReturnsAccessor.metrics.

    >>> ret_acc.stats()
    Start                                      0
    End                                        4
    Duration                     5 days 00:00:00
    Total Return [%]                           0
    Benchmark Return [%]                       0
    Annualized Return [%]                      0
    Annualized Volatility [%]            184.643
    Sharpe Ratio                        0.691185
    Calmar Ratio                               0
    Max Drawdown [%]                     15.3846
    Omega Ratio                          1.08727
    Sortino Ratio                        1.17805
    Skew                              0.00151002
    Kurtosis                            -5.94737
    Tail Ratio                           1.08985
    Common Sense Ratio                   1.08985
    Value at Risk                     -0.0823718
    Alpha                                0.78789
    Beta                                 1.83864
    dtype: object

Note

StatsBuilderMixin.stats() does not support grouping.

## Plots

Hint

See PlotsBuilderMixin.plots() and ReturnsAccessor.subplots.

ReturnsAccessor class has a single subplot based on ReturnsAccessor.plot_cumulative():

    >>> ret_acc.plots().show()

## ReturnsAccessor class

    ReturnsAccessor(
        wrapper,
        obj=None,
        bm_returns=None,
        log_returns=False,
        year_freq=None,
        defaults=None,
        **kwargs
    )

Accessor on top of return series. For both, Series and DataFrames.

Accessible via `pd.Series.vbt.returns` and `pd.DataFrame.vbt.returns`.

Args

`obj` :`pd.Series` or `pd.DataFrame`
  Pandas object representing returns.
`bm_returns` :`array_like`
  Pandas object representing benchmark returns.
`log_returns` :`bool`
  Whether returns and benchmark returns are provided as log returns.
`year_freq` :`any`
  Year frequency for annualization purposes.
`defaults` :`dict`
  Defaults that override `defaults` in returns.
`**kwargs`
  Keyword arguments that are passed down to GenericAccessor.

Superclasses

- Analyzable
- AttrResolverMixin
- BaseAccessor
- Cacheable
- Chainable
- Comparable
- Configured
- ExtPandasIndexer
- GenericAccessor
- HasSettings
- IndexingBase
- PandasIndexer
- Pickleable
- PlotsBuilderMixin
- Prettified
- StatsBuilderMixin
- Wrapping

Inherited members

- AttrResolverMixin.deep_getattr()
- AttrResolverMixin.post_resolve_attr()
- AttrResolverMixin.pre_resolve_attr()
- AttrResolverMixin.resolve_attr()
- AttrResolverMixin.resolve_shortcut_attr()
- BaseAccessor.align()
- BaseAccessor.align_to()
- BaseAccessor.apply()
- BaseAccessor.apply_and_concat()
- BaseAccessor.apply_on_index()
- BaseAccessor.broadcast()
- BaseAccessor.broadcast_combs()
- BaseAccessor.broadcast_to()
- BaseAccessor.column_stack()
- BaseAccessor.combine()
- BaseAccessor.concat()
- BaseAccessor.cross()
- BaseAccessor.cross()
- BaseAccessor.cross_with()
- BaseAccessor.drop_duplicate_levels()
- BaseAccessor.drop_levels()
- BaseAccessor.drop_redundant_levels()
- BaseAccessor.empty()
- BaseAccessor.empty_like()
- BaseAccessor.eval()
- BaseAccessor.get()
- BaseAccessor.indexing_setter_func()
- BaseAccessor.make_symmetric()
- BaseAccessor.rename_levels()
- BaseAccessor.repeat()
- BaseAccessor.resolve_shape()
- BaseAccessor.row_stack()
- BaseAccessor.select_levels()
- BaseAccessor.set()
- BaseAccessor.set_between()
- BaseAccessor.stack_index()
- BaseAccessor.tile()
- BaseAccessor.to_1d_array()
- BaseAccessor.to_2d_array()
- BaseAccessor.to_dict()
- BaseAccessor.unstack_to_array()
- BaseAccessor.unstack_to_df()
- Cacheable.get_ca_setup()
- Chainable.pipe()
- Configured.copy()
- Configured.equals()
- Configured.get_writeable_attrs()
- Configured.prettify()
- Configured.replace()
- Configured.resolve_merge_kwargs()
- Configured.update_config()
- GenericAccessor.ago()
- GenericAccessor.all_ago()
- GenericAccessor.any_ago()
- GenericAccessor.apply_along_axis()
- GenericAccessor.apply_and_reduce()
- GenericAccessor.apply_mapping()
- GenericAccessor.areaplot()
- GenericAccessor.barplot()
- GenericAccessor.bfill()
- GenericAccessor.binarize()
- GenericAccessor.boxplot()
- GenericAccessor.bshift()
- GenericAccessor.cls_dir
- GenericAccessor.column_apply()
- GenericAccessor.column_only_select
- GenericAccessor.config
- GenericAccessor.corr()
- GenericAccessor.count()
- GenericAccessor.cov()
- GenericAccessor.crossed_above()
- GenericAccessor.crossed_below()
- GenericAccessor.cumprod()
- GenericAccessor.cumsum()
- GenericAccessor.demean()
- GenericAccessor.describe()
- GenericAccessor.df_accessor_cls
- GenericAccessor.diff()
- GenericAccessor.digitize()
- GenericAccessor.ewm_mean()
- GenericAccessor.ewm_std()
- GenericAccessor.expanding_apply()
- GenericAccessor.expanding_corr()
- GenericAccessor.expanding_cov()
- GenericAccessor.expanding_idxmax()
- GenericAccessor.expanding_idxmin()
- GenericAccessor.expanding_max()
- GenericAccessor.expanding_mean()
- GenericAccessor.expanding_min()
- GenericAccessor.expanding_ols()
- GenericAccessor.expanding_rank()
- GenericAccessor.expanding_std()
- GenericAccessor.expanding_zscore()
- GenericAccessor.fbfill()
- GenericAccessor.ffill()
- GenericAccessor.fillna()
- GenericAccessor.find_pattern()
- GenericAccessor.flatten_grouped()
- GenericAccessor.fshift()
- GenericAccessor.get_ranges()
- GenericAccessor.group_select
- GenericAccessor.groupby_apply()
- GenericAccessor.groupby_transform()
- GenericAccessor.heatmap()
- GenericAccessor.histplot()
- GenericAccessor.idxmax()
- GenericAccessor.idxmin()
- GenericAccessor.iloc
- GenericAccessor.indexing_kwargs
- GenericAccessor.lineplot()
- GenericAccessor.loc
- GenericAccessor.ma()
- GenericAccessor.map()
- GenericAccessor.mapping
- GenericAccessor.max()
- GenericAccessor.maxabs_scale()
- GenericAccessor.mean()
- GenericAccessor.median()
- GenericAccessor.min()
- GenericAccessor.minmax_scale()
- GenericAccessor.msd()
- GenericAccessor.normalize()
- GenericAccessor.obj
- GenericAccessor.overlay_with_heatmap()
- GenericAccessor.pct_change()
- GenericAccessor.plot()
- GenericAccessor.plot_against()
- GenericAccessor.plot_pattern()
- GenericAccessor.power_transform()
- GenericAccessor.product()
- GenericAccessor.proximity_apply()
- GenericAccessor.qqplot()
- GenericAccessor.quantile_transform()
- GenericAccessor.range_only_select
- GenericAccessor.ranges
- GenericAccessor.rank()
- GenericAccessor.realign()
- GenericAccessor.realign_closing()
- GenericAccessor.realign_opening()
- GenericAccessor.rebase()
- GenericAccessor.rec_state
- GenericAccessor.reduce()
- GenericAccessor.resample_apply()
- GenericAccessor.resample_between_bounds()
- GenericAccessor.resample_to_index()
- GenericAccessor.resolve_mapping()
- GenericAccessor.robust_scale()
- GenericAccessor.rolling_all()
- GenericAccessor.rolling_any()
- GenericAccessor.rolling_apply()
- GenericAccessor.rolling_corr()
- GenericAccessor.rolling_cov()
- GenericAccessor.rolling_idxmax()
- GenericAccessor.rolling_idxmin()
- GenericAccessor.rolling_max()
- GenericAccessor.rolling_mean()
- GenericAccessor.rolling_min()
- GenericAccessor.rolling_ols()
- GenericAccessor.rolling_pattern_similarity()
- GenericAccessor.rolling_prod()
- GenericAccessor.rolling_rank()
- GenericAccessor.rolling_std()
- GenericAccessor.rolling_sum()
- GenericAccessor.rolling_zscore()
- GenericAccessor.row_apply()
- GenericAccessor.scale()
- GenericAccessor.scatterplot()
- GenericAccessor.self_aliases
- GenericAccessor.shuffle()
- GenericAccessor.squeeze_grouped()
- GenericAccessor.sr_accessor_cls
- GenericAccessor.std()
- GenericAccessor.sum()
- GenericAccessor.to_daily_log_returns()
- GenericAccessor.to_daily_returns()
- GenericAccessor.to_log_returns()
- GenericAccessor.to_mapped()
- GenericAccessor.to_returns()
- GenericAccessor.transform()
- GenericAccessor.ts_heatmap()
- GenericAccessor.value_counts()
- GenericAccessor.vidya()
- GenericAccessor.volume()
- GenericAccessor.wm_mean()
- GenericAccessor.wrapper
- GenericAccessor.wwm_mean()
- GenericAccessor.wwm_std()
- GenericAccessor.xloc
- GenericAccessor.zscore()
- HasSettings.get_path_setting()
- HasSettings.get_path_settings()
- HasSettings.get_setting()
- HasSettings.get_settings()
- HasSettings.has_path_setting()
- HasSettings.has_path_settings()
- HasSettings.has_setting()
- HasSettings.has_settings()
- HasSettings.reset_settings()
- HasSettings.resolve_setting()
- HasSettings.resolve_settings_paths()
- HasSettings.set_settings()
- PandasIndexer.xs()
- Pickleable.decode_config()
- Pickleable.decode_config_node()
- Pickleable.dumps()
- Pickleable.encode_config()
- Pickleable.encode_config_node()
- Pickleable.file_exists()
- Pickleable.getsize()
- Pickleable.load()
- Pickleable.loads()
- Pickleable.modify_state()
- Pickleable.resolve_file_path()
- Pickleable.save()
- PlotsBuilderMixin.build_subplots_doc()
- PlotsBuilderMixin.override_subplots_doc()
- PlotsBuilderMixin.plots()
- StatsBuilderMixin.build_metrics_doc()
- StatsBuilderMixin.override_metrics_doc()
- StatsBuilderMixin.stats()
- Wrapping.regroup()
- Wrapping.resolve_stack_kwargs()
- Wrapping.select_col()
- Wrapping.select_col_from_obj()
- Wrapping.split()

Subclasses

- ReturnsDFAccessor
- ReturnsSRAccessor

### alpha method

    ReturnsAccessor.alpha(
        bm_returns=None,
        risk_free=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Alpha.

See alpha_nb().

### ann_factor property

Annualization factor.

### ann_factor_to_year_freq class method

    ReturnsAccessor.ann_factor_to_year_freq(
        ann_factor,
        freq,
        method_name=None
    )

Convert annualization factor into year frequency.

### annual method

    ReturnsAccessor.annual(
        jitted=None,
        chunked=None,
        **kwargs
    )

Annual returns.

### annualized method

    ReturnsAccessor.annualized(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Annualized return.

See annualized_return_nb().

### annualized_volatility method

    ReturnsAccessor.annualized_volatility(
        levy_alpha=None,
        ddof=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Annualized volatility.

See annualized_volatility_nb().

### auto_detect_ann_factor class method

    ReturnsAccessor.auto_detect_ann_factor(
        index
    )

Auto-detect annualization factor from a datetime index.

### beta method

    ReturnsAccessor.beta(
        bm_returns=None,
        ddof=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Beta.

See beta_nb().

### bm_returns property

Benchmark returns.

### calmar_ratio method

    ReturnsAccessor.calmar_ratio(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Calmar ratio.

See calmar_ratio_nb().

### capture_ratio method

    ReturnsAccessor.capture_ratio(
        bm_returns=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Capture ratio.

See capture_ratio_nb().

### common_sense_ratio method

    ReturnsAccessor.common_sense_ratio(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Common Sense Ratio.

See common_sense_ratio_nb().

### cond_value_at_risk method

    ReturnsAccessor.cond_value_at_risk(
        cutoff=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Conditional value at risk.

See cond_value_at_risk_nb().

### cumulative method

    ReturnsAccessor.cumulative(
        start_value=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Cumulative return.

See cum_returns_nb().

### daily method

    ReturnsAccessor.daily(
        jitted=None,
        chunked=None,
        **kwargs
    )

Daily returns.

### deannualize method

    ReturnsAccessor.deannualize(
        value
    )

Deannualize a value.

### defaults property

Defaults for ReturnsAccessor.

Merges `defaults` from returns with `defaults` from ReturnsAccessor.

### deflated_sharpe_ratio method

    ReturnsAccessor.deflated_sharpe_ratio(
        risk_free=None,
        ddof=None,
        bias=True,
        wrap_kwargs=None
    )

Deflated Sharpe Ratio (DSR).

Expresses the chance that the advertised strategy has a positive Sharpe ratio.

### down_capture_ratio method

    ReturnsAccessor.down_capture_ratio(
        bm_returns=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Down-market capture ratio.

See down_capture_ratio_nb().

### downside_risk method

    ReturnsAccessor.downside_risk(
        required_return=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Downside risk.

See downside_risk_nb().

### drawdown method

    ReturnsAccessor.drawdown(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Relative decline from a peak.

### drawdowns property

ReturnsAccessor.get_drawdowns() with default arguments.

### from_value class method

    ReturnsAccessor.from_value(
        value,
        init_value=nan,
        log_returns=False,
        jitted=None,
        chunked=None,
        wrapper=None,
        wrapper_kwargs=None,
        return_values=False,
        **kwargs
    )

Returns a new ReturnsAccessor instance with returns calculated from `value`.

### get_ann_factor class method

    ReturnsAccessor.get_ann_factor(
        year_freq=None,
        freq=None,
        raise_error=False
    )

Get the annualization factor from the year and data frequency.

### get_drawdowns method

    ReturnsAccessor.get_drawdowns(
        jitted=None,
        chunked=None,
        wrapper_kwargs=None,
        **kwargs
    )

Generate drawdown records of cumulative returns.

See Drawdowns.

### get_year_freq class method

    ReturnsAccessor.get_year_freq(
        year_freq=None,
        index=None,
        freq=None
    )

Resolve year frequency.

If `year_freq` is "auto", uses ReturnsAccessor.auto_detect_ann_factor(). If `year_freq` is "auto_[method_name]`, also applies the method`np.[method_name]`to the annualization factor, mostly to round it. If`year_freq`is "index_[method_name]", uses [ReturnsAccessor.parse_ann_factor()](https://vectorbt.pro/pvt_321460c7/api/returns/accessors/#vectorbtpro.returns.accessors.ReturnsAccessor.parse_ann_factor "vectorbtpro.returns.accessors.ReturnsAccessor.parse_ann_factor") to determine the annualization factor by applying the method to`pd.DatetimeIndex.year`.

### indexing_func method

    ReturnsAccessor.indexing_func(
        *args,
        wrapper_meta=None,
        **kwargs
    )

Perform indexing on ReturnsAccessor.

### information_ratio method

    ReturnsAccessor.information_ratio(
        bm_returns=None,
        ddof=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Information ratio.

See information_ratio_nb().

### log_returns property

Whether returns and benchmark returns are provided as log returns.

### max_drawdown method

    ReturnsAccessor.max_drawdown(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Maximum drawdown.

See max_drawdown_nb().

Yields the same out as `max_drawdown` of ReturnsAccessor.drawdowns.

### metrics class variable

Metrics supported by ReturnsAccessor.

    HybridConfig(
        start=dict(
            title='Start',
            calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbeb90>,
            agg_func=None,
            check_is_not_grouped=False,
            tags='wrapper'
        ),
        end=dict(
            title='End',
            calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbec20>,
            agg_func=None,
            check_is_not_grouped=False,
            tags='wrapper'
        ),
        period=dict(
            title='Period',
            calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbecb0>,
            apply_to_timedelta=True,
            agg_func=None,
            check_is_not_grouped=False,
            tags='wrapper'
        ),
        total_return=dict(
            title='Total Return [%]',
            calc_func='total',
            post_calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbed40>,
            tags='returns'
        ),
        bm_return=dict(
            title='Benchmark Return [%]',
            calc_func='bm_returns.vbt.returns.total',
            post_calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbedd0>,
            check_has_bm_returns=True,
            tags='returns'
        ),
        ann_return=dict(
            title='Annualized Return [%]',
            calc_func='annualized',
            post_calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbee60>,
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        ann_volatility=dict(
            title='Annualized Volatility [%]',
            calc_func='annualized_volatility',
            post_calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbeef0>,
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        max_dd=dict(
            title='Max Drawdown [%]',
            calc_func='drawdowns.get_max_drawdown',
            post_calc_func=<function ReturnsAccessor.<lambda> at 0x7ff34adbef80>,
            tags=[
                'returns',
                'drawdowns'
            ]
        ),
        max_dd_duration=dict(
            title='Max Drawdown Duration',
            calc_func='drawdowns.get_max_duration',
            fill_wrap_kwargs=True,
            tags=[
                'returns',
                'drawdowns',
                'duration'
            ]
        ),
        sharpe_ratio=dict(
            title='Sharpe Ratio',
            calc_func='sharpe_ratio',
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        calmar_ratio=dict(
            title='Calmar Ratio',
            calc_func='calmar_ratio',
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        omega_ratio=dict(
            title='Omega Ratio',
            calc_func='omega_ratio',
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        sortino_ratio=dict(
            title='Sortino Ratio',
            calc_func='sortino_ratio',
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        skew=dict(
            title='Skew',
            calc_func='obj.skew',
            tags='returns'
        ),
        kurtosis=dict(
            title='Kurtosis',
            calc_func='obj.kurtosis',
            tags='returns'
        ),
        tail_ratio=dict(
            title='Tail Ratio',
            calc_func='tail_ratio',
            tags='returns'
        ),
        common_sense_ratio=dict(
            title='Common Sense Ratio',
            calc_func='common_sense_ratio',
            check_has_freq=True,
            check_has_year_freq=True,
            tags='returns'
        ),
        value_at_risk=dict(
            title='Value at Risk',
            calc_func='value_at_risk',
            tags='returns'
        ),
        alpha=dict(
            title='Alpha',
            calc_func='alpha',
            check_has_freq=True,
            check_has_year_freq=True,
            check_has_bm_returns=True,
            tags='returns'
        ),
        beta=dict(
            title='Beta',
            calc_func='beta',
            check_has_bm_returns=True,
            tags='returns'
        )
    )

Returns `ReturnsAccessor._metrics`, which gets (hybrid-) copied upon creation of each instance. Thus, changing this config won't affect the class.

To change metrics, you can either change the config in-place, override this property, or overwrite the instance variable `ReturnsAccessor._metrics`.

### omega_ratio method

    ReturnsAccessor.omega_ratio(
        risk_free=None,
        required_return=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Omega ratio.

See omega_ratio_nb().

### parse_ann_factor class method

    ReturnsAccessor.parse_ann_factor(
        index,
        method_name='max'
    )

Parse annualization factor from a datetime index.

### plot_cumulative method

    ReturnsAccessor.plot_cumulative(
        column=None,
        bm_returns=None,
        start_value=1,
        fill_to_benchmark=False,
        main_kwargs=None,
        bm_kwargs=None,
        pct_scale=False,
        hline_shape_kwargs=None,
        add_trace_kwargs=None,
        xref='x',
        yref='y',
        fig=None,
        **layout_kwargs
    )

Plot cumulative returns.

Args

`column` :`str`
  Name of the column to plot.
`bm_returns` :`array_like`
  Benchmark return to compare returns against. Will broadcast per element.
`start_value` :`float`
  The starting returns.
`fill_to_benchmark` :`bool`
  Whether to fill between main and benchmark, or between main and `start_value`.
`main_kwargs` :`dict`
  Keyword arguments passed to GenericAccessor.plot() for main.
`bm_kwargs` :`dict`
  Keyword arguments passed to GenericAccessor.plot() for benchmark.
`pct_scale` :`bool`
  Whether to use the percentage scale for the y-axis.
`hline_shape_kwargs` :`dict`
  Keyword arguments passed to `plotly.graph_objects.Figure.add_shape` for `start_value` line.
`add_trace_kwargs` :`dict`
  Keyword arguments passed to `add_trace`.
`xref` :`str`
  X coordinate axis.
`yref` :`str`
  Y coordinate axis.
`fig` :`Figure` or `FigureWidget`
  Figure to add traces to.
`**layout_kwargs`
  Keyword arguments for layout.

Usage

    >>> np.random.seed(0)
    >>> rets = pd.Series(np.random.uniform(-0.05, 0.05, size=100))
    >>> bm_returns = pd.Series(np.random.uniform(-0.05, 0.05, size=100))
    >>> rets.vbt.returns.plot_cumulative(bm_returns=bm_returns).show()

### plots_defaults property

Defaults for PlotsBuilderMixin.plots().

Merges GenericAccessor.plots_defaults, defaults from ReturnsAccessor.defaults (acting as `settings`), and `plots` from returns

### prob_sharpe_ratio method

    ReturnsAccessor.prob_sharpe_ratio(
        bm_returns=None,
        risk_free=None,
        ddof=None,
        bias=True,
        wrap_kwargs=None
    )

Probabilistic Sharpe Ratio (PSR).

### profit_factor method

    ReturnsAccessor.profit_factor(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Profit factor.

See profit_factor_nb().

### qs property

Quantstats adapter.

### resample method

    ReturnsAccessor.resample(
        *args,
        fill_with_zero=True,
        wrapper_meta=None,
        **kwargs
    )

Perform resampling on ReturnsAccessor.

### resample_returns method

    ReturnsAccessor.resample_returns(
        rule,
        jitted=None,
        chunked=None,
        **kwargs
    )

Resample returns to a custom frequency, date offset, or index.

### resolve_column_stack_kwargs class method

    ReturnsAccessor.resolve_column_stack_kwargs(
        *objs,
        reindex_kwargs=None,
        **kwargs
    )

Resolve keyword arguments for initializing ReturnsAccessor after stacking along columns.

### resolve_row_stack_kwargs class method

    ReturnsAccessor.resolve_row_stack_kwargs(
        *objs,
        **kwargs
    )

Resolve keyword arguments for initializing ReturnsAccessor after stacking along rows.

### resolve_self method

    ReturnsAccessor.resolve_self(
        cond_kwargs=None,
        custom_arg_names=None,
        impacts_caching=True,
        silence_warnings=False
    )

Resolve self.

See Wrapping.resolve_self().

Creates a copy of this instance `year_freq` is different in `cond_kwargs`.

### rolling_alpha method

    ReturnsAccessor.rolling_alpha(
        bm_returns=None,
        window=None,
        minp=None,
        risk_free=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.alpha().

### rolling_annualized method

    ReturnsAccessor.rolling_annualized(
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.annualized().

### rolling_annualized_volatility method

    ReturnsAccessor.rolling_annualized_volatility(
        window=None,
        minp=None,
        levy_alpha=None,
        ddof=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.annualized_volatility().

### rolling_beta method

    ReturnsAccessor.rolling_beta(
        bm_returns=None,
        ddof=None,
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.beta().

### rolling_calmar_ratio method

    ReturnsAccessor.rolling_calmar_ratio(
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.calmar_ratio().

### rolling_capture_ratio method

    ReturnsAccessor.rolling_capture_ratio(
        bm_returns=None,
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.capture_ratio().

### rolling_common_sense_ratio method

    ReturnsAccessor.rolling_common_sense_ratio(
        window=None,
        minp=None,
        jitted=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.common_sense_ratio().

### rolling_cond_value_at_risk method

    ReturnsAccessor.rolling_cond_value_at_risk(
        window=None,
        minp=None,
        cutoff=None,
        noarr_mode=True,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.cond_value_at_risk().

### rolling_down_capture_ratio method

    ReturnsAccessor.rolling_down_capture_ratio(
        bm_returns=None,
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.down_capture_ratio().

### rolling_downside_risk method

    ReturnsAccessor.rolling_downside_risk(
        window=None,
        minp=None,
        required_return=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.downside_risk().

### rolling_information_ratio method

    ReturnsAccessor.rolling_information_ratio(
        bm_returns=None,
        window=None,
        minp=None,
        ddof=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.information_ratio().

### rolling_max_drawdown method

    ReturnsAccessor.rolling_max_drawdown(
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.max_drawdown().

### rolling_omega_ratio method

    ReturnsAccessor.rolling_omega_ratio(
        window=None,
        minp=None,
        risk_free=None,
        required_return=None,
        jitted=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.omega_ratio().

### rolling_profit_factor method

    ReturnsAccessor.rolling_profit_factor(
        window=None,
        minp=None,
        jitted=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.profit_factor().

### rolling_sharpe_ratio method

    ReturnsAccessor.rolling_sharpe_ratio(
        window=None,
        annualized=True,
        minp=None,
        risk_free=None,
        ddof=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Rolling version of ReturnsAccessor.sharpe_ratio().

Uses rolling_sharpe_ratio_nb().

### rolling_sortino_ratio method

    ReturnsAccessor.rolling_sortino_ratio(
        window=None,
        minp=None,
        required_return=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.sortino_ratio().

### rolling_tail_ratio method

    ReturnsAccessor.rolling_tail_ratio(
        window=None,
        minp=None,
        noarr_mode=True,
        jitted=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.tail_ratio().

### rolling_total method

    ReturnsAccessor.rolling_total(
        window=None,
        minp=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.total().

### rolling_up_capture_ratio method

    ReturnsAccessor.rolling_up_capture_ratio(
        bm_returns=None,
        window=None,
        minp=None,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.up_capture_ratio().

### rolling_value_at_risk method

    ReturnsAccessor.rolling_value_at_risk(
        window=None,
        minp=None,
        cutoff=None,
        noarr_mode=True,
        jitted=None,
        chunked=None,
        **kwargs
    )

Rolling version of ReturnsAccessor.value_at_risk().

### sharpe_ratio method

    ReturnsAccessor.sharpe_ratio(
        annualized=True,
        risk_free=None,
        ddof=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Sharpe ratio.

See sharpe_ratio_nb().

### sharpe_ratio_std method

    ReturnsAccessor.sharpe_ratio_std(
        risk_free=None,
        ddof=None,
        bias=True,
        wrap_kwargs=None
    )

Standard deviation of the sharpe ratio estimation.

### sortino_ratio method

    ReturnsAccessor.sortino_ratio(
        required_return=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Sortino ratio.

See sortino_ratio_nb().

### stats_defaults property

Defaults for StatsBuilderMixin.stats().

Merges GenericAccessor.stats_defaults, defaults from ReturnsAccessor.defaults (acting as `settings`), and `stats` from returns

### subplots class variable

Subplots supported by ReturnsAccessor.

    HybridConfig(
        plot_cumulative=dict(
            title='Cumulative Returns',
            yaxis_kwargs=dict(
                title='Cumulative returns'
            ),
            plot_func='plot_cumulative',
            pass_hline_shape_kwargs=True,
            pass_add_trace_kwargs=True,
            pass_xref=True,
            pass_yref=True,
            tags='returns'
        )
    )

Returns `ReturnsAccessor._subplots`, which gets (hybrid-) copied upon creation of each instance. Thus, changing this config won't affect the class.

To change subplots, you can either change the config in-place, override this property, or overwrite the instance variable `ReturnsAccessor._subplots`.

### tail_ratio method

    ReturnsAccessor.tail_ratio(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Tail ratio.

See tail_ratio_nb().

### total method

    ReturnsAccessor.total(
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Total return.

See cum_returns_final_nb().

### up_capture_ratio method

    ReturnsAccessor.up_capture_ratio(
        bm_returns=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Up-market capture ratio.

See up_capture_ratio_nb().

### value_at_risk method

    ReturnsAccessor.value_at_risk(
        cutoff=None,
        jitted=None,
        chunked=None,
        wrap_kwargs=None
    )

Value at risk.

See value_at_risk_nb().

### year_freq property

Year frequency.

### year_freq_depends_on_index class method

    ReturnsAccessor.year_freq_depends_on_index(
        year_freq
    )

Return whether frequency depends on index.

## ReturnsDFAccessor class

    ReturnsDFAccessor(
        wrapper,
        obj=None,
        bm_returns=None,
        year_freq=None,
        defaults=None,
        **kwargs
    )

Accessor on top of return series. For DataFrames only.

Accessible via `pd.DataFrame.vbt.returns`.

Superclasses

- Analyzable
- AttrResolverMixin
- BaseAccessor
- BaseDFAccessor
- Cacheable
- Chainable
- Comparable
- Configured
- ExtPandasIndexer
- GenericAccessor
- GenericDFAccessor
- HasSettings
- IndexingBase
- PandasIndexer
- Pickleable
- PlotsBuilderMixin
- Prettified
- ReturnsAccessor
- StatsBuilderMixin
- Wrapping

Inherited members

- AttrResolverMixin.deep_getattr()
- AttrResolverMixin.post_resolve_attr()
- AttrResolverMixin.pre_resolve_attr()
- AttrResolverMixin.resolve_attr()
- AttrResolverMixin.resolve_shortcut_attr()
- BaseAccessor.align()
- BaseAccessor.align_to()
- BaseAccessor.apply()
- BaseAccessor.apply_and_concat()
- BaseAccessor.apply_on_index()
- BaseAccessor.broadcast()
- BaseAccessor.broadcast_combs()
- BaseAccessor.broadcast_to()
- BaseAccessor.column_stack()
- BaseAccessor.combine()
- BaseAccessor.concat()
- BaseAccessor.cross()
- BaseAccessor.cross()
- BaseAccessor.cross_with()
- BaseAccessor.drop_duplicate_levels()
- BaseAccessor.drop_levels()
- BaseAccessor.drop_redundant_levels()
- BaseAccessor.empty()
- BaseAccessor.empty_like()
- BaseAccessor.eval()
- BaseAccessor.get()
- BaseAccessor.indexing_setter_func()
- BaseAccessor.make_symmetric()
- BaseAccessor.rename_levels()
- BaseAccessor.repeat()
- BaseAccessor.resolve_shape()
- BaseAccessor.row_stack()
- BaseAccessor.select_levels()
- BaseAccessor.set()
- BaseAccessor.set_between()
- BaseAccessor.stack_index()
- BaseAccessor.tile()
- BaseAccessor.to_1d_array()
- BaseAccessor.to_2d_array()
- BaseAccessor.to_dict()
- BaseAccessor.unstack_to_array()
- BaseAccessor.unstack_to_df()
- Cacheable.get_ca_setup()
- Chainable.pipe()
- Configured.copy()
- Configured.equals()
- Configured.get_writeable_attrs()
- Configured.prettify()
- Configured.replace()
- Configured.resolve_merge_kwargs()
- Configured.update_config()
- GenericAccessor.ago()
- GenericAccessor.all_ago()
- GenericAccessor.any_ago()
- GenericAccessor.apply_along_axis()
- GenericAccessor.apply_and_reduce()
- GenericAccessor.apply_mapping()
- GenericAccessor.areaplot()
- GenericAccessor.barplot()
- GenericAccessor.bfill()
- GenericAccessor.binarize()
- GenericAccessor.boxplot()
- GenericAccessor.bshift()
- GenericAccessor.column_apply()
- GenericAccessor.corr()
- GenericAccessor.count()
- GenericAccessor.cov()
- GenericAccessor.crossed_above()
- GenericAccessor.crossed_below()
- GenericAccessor.cumprod()
- GenericAccessor.cumsum()
- GenericAccessor.demean()
- GenericAccessor.describe()
- GenericAccessor.diff()
- GenericAccessor.digitize()
- GenericAccessor.ewm_mean()
- GenericAccessor.ewm_std()
- GenericAccessor.expanding_apply()
- GenericAccessor.expanding_corr()
- GenericAccessor.expanding_cov()
- GenericAccessor.expanding_idxmax()
- GenericAccessor.expanding_idxmin()
- GenericAccessor.expanding_max()
- GenericAccessor.expanding_mean()
- GenericAccessor.expanding_min()
- GenericAccessor.expanding_ols()
- GenericAccessor.expanding_rank()
- GenericAccessor.expanding_std()
- GenericAccessor.expanding_zscore()
- GenericAccessor.fbfill()
- GenericAccessor.ffill()
- GenericAccessor.fillna()
- GenericAccessor.find_pattern()
- GenericAccessor.flatten_grouped()
- GenericAccessor.fshift()
- GenericAccessor.get_ranges()
- GenericAccessor.groupby_apply()
- GenericAccessor.groupby_transform()
- GenericAccessor.heatmap()
- GenericAccessor.histplot()
- GenericAccessor.idxmax()
- GenericAccessor.idxmin()
- GenericAccessor.lineplot()
- GenericAccessor.ma()
- GenericAccessor.map()
- GenericAccessor.max()
- GenericAccessor.maxabs_scale()
- GenericAccessor.mean()
- GenericAccessor.median()
- GenericAccessor.min()
- GenericAccessor.minmax_scale()
- GenericAccessor.msd()
- GenericAccessor.normalize()
- GenericAccessor.overlay_with_heatmap()
- GenericAccessor.pct_change()
- GenericAccessor.plot()
- GenericAccessor.plot_against()
- GenericAccessor.plot_pattern()
- GenericAccessor.power_transform()
- GenericAccessor.product()
- GenericAccessor.proximity_apply()
- GenericAccessor.qqplot()
- GenericAccessor.quantile_transform()
- GenericAccessor.rank()
- GenericAccessor.realign()
- GenericAccessor.realign_closing()
- GenericAccessor.realign_opening()
- GenericAccessor.rebase()
- GenericAccessor.reduce()
- GenericAccessor.resample_apply()
- GenericAccessor.resample_between_bounds()
- GenericAccessor.resample_to_index()
- GenericAccessor.resolve_mapping()
- GenericAccessor.robust_scale()
- GenericAccessor.rolling_all()
- GenericAccessor.rolling_any()
- GenericAccessor.rolling_apply()
- GenericAccessor.rolling_corr()
- GenericAccessor.rolling_cov()
- GenericAccessor.rolling_idxmax()
- GenericAccessor.rolling_idxmin()
- GenericAccessor.rolling_max()
- GenericAccessor.rolling_mean()
- GenericAccessor.rolling_min()
- GenericAccessor.rolling_ols()
- GenericAccessor.rolling_pattern_similarity()
- GenericAccessor.rolling_prod()
- GenericAccessor.rolling_rank()
- GenericAccessor.rolling_std()
- GenericAccessor.rolling_sum()
- GenericAccessor.rolling_zscore()
- GenericAccessor.row_apply()
- GenericAccessor.scale()
- GenericAccessor.scatterplot()
- GenericAccessor.shuffle()
- GenericAccessor.squeeze_grouped()
- GenericAccessor.std()
- GenericAccessor.sum()
- GenericAccessor.to_daily_log_returns()
- GenericAccessor.to_daily_returns()
- GenericAccessor.to_log_returns()
- GenericAccessor.to_mapped()
- GenericAccessor.to_returns()
- GenericAccessor.transform()
- GenericAccessor.ts_heatmap()
- GenericAccessor.value_counts()
- GenericAccessor.vidya()
- GenericAccessor.volume()
- GenericAccessor.wm_mean()
- GenericAccessor.wwm_mean()
- GenericAccessor.wwm_std()
- GenericAccessor.zscore()
- GenericDFAccessor.band()
- GenericDFAccessor.plot_projections()
- HasSettings.get_path_setting()
- HasSettings.get_path_settings()
- HasSettings.get_setting()
- HasSettings.get_settings()
- HasSettings.has_path_setting()
- HasSettings.has_path_settings()
- HasSettings.has_setting()
- HasSettings.has_settings()
- HasSettings.reset_settings()
- HasSettings.resolve_setting()
- HasSettings.resolve_settings_paths()
- HasSettings.set_settings()
- PandasIndexer.xs()
- Pickleable.decode_config()
- Pickleable.decode_config_node()
- Pickleable.dumps()
- Pickleable.encode_config()
- Pickleable.encode_config_node()
- Pickleable.file_exists()
- Pickleable.getsize()
- Pickleable.load()
- Pickleable.loads()
- Pickleable.modify_state()
- Pickleable.resolve_file_path()
- Pickleable.save()
- PlotsBuilderMixin.build_subplots_doc()
- PlotsBuilderMixin.override_subplots_doc()
- PlotsBuilderMixin.plots()
- ReturnsAccessor.alpha()
- ReturnsAccessor.ann_factor
- ReturnsAccessor.ann_factor_to_year_freq()
- ReturnsAccessor.annual()
- ReturnsAccessor.annualized()
- ReturnsAccessor.annualized_volatility()
- ReturnsAccessor.auto_detect_ann_factor()
- ReturnsAccessor.beta()
- ReturnsAccessor.bm_returns
- ReturnsAccessor.calmar_ratio()
- ReturnsAccessor.capture_ratio()
- ReturnsAccessor.cls_dir
- ReturnsAccessor.column_only_select
- ReturnsAccessor.common_sense_ratio()
- ReturnsAccessor.cond_value_at_risk()
- ReturnsAccessor.config
- ReturnsAccessor.cumulative()
- ReturnsAccessor.daily()
- ReturnsAccessor.deannualize()
- ReturnsAccessor.defaults
- ReturnsAccessor.deflated_sharpe_ratio()
- ReturnsAccessor.df_accessor_cls
- ReturnsAccessor.down_capture_ratio()
- ReturnsAccessor.downside_risk()
- ReturnsAccessor.drawdown()
- ReturnsAccessor.drawdowns
- ReturnsAccessor.from_value()
- ReturnsAccessor.get_ann_factor()
- ReturnsAccessor.get_drawdowns()
- ReturnsAccessor.get_year_freq()
- ReturnsAccessor.group_select
- ReturnsAccessor.iloc
- ReturnsAccessor.indexing_func()
- ReturnsAccessor.indexing_kwargs
- ReturnsAccessor.information_ratio()
- ReturnsAccessor.loc
- ReturnsAccessor.log_returns
- ReturnsAccessor.mapping
- ReturnsAccessor.max_drawdown()
- ReturnsAccessor.obj
- ReturnsAccessor.omega_ratio()
- ReturnsAccessor.parse_ann_factor()
- ReturnsAccessor.plot_cumulative()
- ReturnsAccessor.plots_defaults
- ReturnsAccessor.prob_sharpe_ratio()
- ReturnsAccessor.profit_factor()
- ReturnsAccessor.qs
- ReturnsAccessor.range_only_select
- ReturnsAccessor.ranges
- ReturnsAccessor.rec_state
- ReturnsAccessor.resample()
- ReturnsAccessor.resample_returns()
- ReturnsAccessor.resolve_column_stack_kwargs()
- ReturnsAccessor.resolve_row_stack_kwargs()
- ReturnsAccessor.resolve_self()
- ReturnsAccessor.rolling_alpha()
- ReturnsAccessor.rolling_annualized()
- ReturnsAccessor.rolling_annualized_volatility()
- ReturnsAccessor.rolling_beta()
- ReturnsAccessor.rolling_calmar_ratio()
- ReturnsAccessor.rolling_capture_ratio()
- ReturnsAccessor.rolling_common_sense_ratio()
- ReturnsAccessor.rolling_cond_value_at_risk()
- ReturnsAccessor.rolling_down_capture_ratio()
- ReturnsAccessor.rolling_downside_risk()
- ReturnsAccessor.rolling_information_ratio()
- ReturnsAccessor.rolling_max_drawdown()
- ReturnsAccessor.rolling_omega_ratio()
- ReturnsAccessor.rolling_profit_factor()
- ReturnsAccessor.rolling_sharpe_ratio()
- ReturnsAccessor.rolling_sortino_ratio()
- ReturnsAccessor.rolling_tail_ratio()
- ReturnsAccessor.rolling_total()
- ReturnsAccessor.rolling_up_capture_ratio()
- ReturnsAccessor.rolling_value_at_risk()
- ReturnsAccessor.self_aliases
- ReturnsAccessor.sharpe_ratio()
- ReturnsAccessor.sharpe_ratio_std()
- ReturnsAccessor.sortino_ratio()
- ReturnsAccessor.sr_accessor_cls
- ReturnsAccessor.stats_defaults
- ReturnsAccessor.tail_ratio()
- ReturnsAccessor.total()
- ReturnsAccessor.up_capture_ratio()
- ReturnsAccessor.value_at_risk()
- ReturnsAccessor.wrapper
- ReturnsAccessor.xloc
- ReturnsAccessor.year_freq
- ReturnsAccessor.year_freq_depends_on_index()
- StatsBuilderMixin.build_metrics_doc()
- StatsBuilderMixin.override_metrics_doc()
- StatsBuilderMixin.stats()
- Wrapping.regroup()
- Wrapping.resolve_stack_kwargs()
- Wrapping.select_col()
- Wrapping.select_col_from_obj()
- Wrapping.split()

## ReturnsSRAccessor class

    ReturnsSRAccessor(
        wrapper,
        obj=None,
        bm_returns=None,
        year_freq=None,
        defaults=None,
        **kwargs
    )

Accessor on top of return series. For Series only.

Accessible via `pd.Series.vbt.returns`.

Superclasses

- Analyzable
- AttrResolverMixin
- BaseAccessor
- BaseSRAccessor
- Cacheable
- Chainable
- Comparable
- Configured
- ExtPandasIndexer
- GenericAccessor
- GenericSRAccessor
- HasSettings
- IndexingBase
- PandasIndexer
- Pickleable
- PlotsBuilderMixin
- Prettified
- ReturnsAccessor
- StatsBuilderMixin
- Wrapping

Inherited members

- AttrResolverMixin.deep_getattr()
- AttrResolverMixin.post_resolve_attr()
- AttrResolverMixin.pre_resolve_attr()
- AttrResolverMixin.resolve_attr()
- AttrResolverMixin.resolve_shortcut_attr()
- BaseAccessor.align()
- BaseAccessor.align_to()
- BaseAccessor.apply()
- BaseAccessor.apply_and_concat()
- BaseAccessor.apply_on_index()
- BaseAccessor.broadcast()
- BaseAccessor.broadcast_combs()
- BaseAccessor.broadcast_to()
- BaseAccessor.column_stack()
- BaseAccessor.combine()
- BaseAccessor.concat()
- BaseAccessor.cross()
- BaseAccessor.cross()
- BaseAccessor.cross_with()
- BaseAccessor.drop_duplicate_levels()
- BaseAccessor.drop_levels()
- BaseAccessor.drop_redundant_levels()
- BaseAccessor.empty()
- BaseAccessor.empty_like()
- BaseAccessor.eval()
- BaseAccessor.get()
- BaseAccessor.indexing_setter_func()
- BaseAccessor.make_symmetric()
- BaseAccessor.rename_levels()
- BaseAccessor.repeat()
- BaseAccessor.resolve_shape()
- BaseAccessor.row_stack()
- BaseAccessor.select_levels()
- BaseAccessor.set()
- BaseAccessor.set_between()
- BaseAccessor.stack_index()
- BaseAccessor.tile()
- BaseAccessor.to_1d_array()
- BaseAccessor.to_2d_array()
- BaseAccessor.to_dict()
- BaseAccessor.unstack_to_array()
- BaseAccessor.unstack_to_df()
- Cacheable.get_ca_setup()
- Chainable.pipe()
- Configured.copy()
- Configured.equals()
- Configured.get_writeable_attrs()
- Configured.prettify()
- Configured.replace()
- Configured.resolve_merge_kwargs()
- Configured.update_config()
- GenericAccessor.ago()
- GenericAccessor.all_ago()
- GenericAccessor.any_ago()
- GenericAccessor.apply_along_axis()
- GenericAccessor.apply_and_reduce()
- GenericAccessor.apply_mapping()
- GenericAccessor.areaplot()
- GenericAccessor.barplot()
- GenericAccessor.bfill()
- GenericAccessor.binarize()
- GenericAccessor.boxplot()
- GenericAccessor.bshift()
- GenericAccessor.column_apply()
- GenericAccessor.corr()
- GenericAccessor.count()
- GenericAccessor.cov()
- GenericAccessor.crossed_above()
- GenericAccessor.crossed_below()
- GenericAccessor.cumprod()
- GenericAccessor.cumsum()
- GenericAccessor.demean()
- GenericAccessor.describe()
- GenericAccessor.diff()
- GenericAccessor.digitize()
- GenericAccessor.ewm_mean()
- GenericAccessor.ewm_std()
- GenericAccessor.expanding_apply()
- GenericAccessor.expanding_corr()
- GenericAccessor.expanding_cov()
- GenericAccessor.expanding_idxmax()
- GenericAccessor.expanding_idxmin()
- GenericAccessor.expanding_max()
- GenericAccessor.expanding_mean()
- GenericAccessor.expanding_min()
- GenericAccessor.expanding_ols()
- GenericAccessor.expanding_rank()
- GenericAccessor.expanding_std()
- GenericAccessor.expanding_zscore()
- GenericAccessor.fbfill()
- GenericAccessor.ffill()
- GenericAccessor.fillna()
- GenericAccessor.find_pattern()
- GenericAccessor.flatten_grouped()
- GenericAccessor.fshift()
- GenericAccessor.get_ranges()
- GenericAccessor.groupby_apply()
- GenericAccessor.groupby_transform()
- GenericAccessor.heatmap()
- GenericAccessor.histplot()
- GenericAccessor.idxmax()
- GenericAccessor.idxmin()
- GenericAccessor.lineplot()
- GenericAccessor.ma()
- GenericAccessor.map()
- GenericAccessor.max()
- GenericAccessor.maxabs_scale()
- GenericAccessor.mean()
- GenericAccessor.median()
- GenericAccessor.min()
- GenericAccessor.minmax_scale()
- GenericAccessor.msd()
- GenericAccessor.normalize()
- GenericAccessor.overlay_with_heatmap()
- GenericAccessor.pct_change()
- GenericAccessor.plot()
- GenericAccessor.plot_against()
- GenericAccessor.plot_pattern()
- GenericAccessor.power_transform()
- GenericAccessor.product()
- GenericAccessor.proximity_apply()
- GenericAccessor.qqplot()
- GenericAccessor.quantile_transform()
- GenericAccessor.rank()
- GenericAccessor.realign()
- GenericAccessor.realign_closing()
- GenericAccessor.realign_opening()
- GenericAccessor.rebase()
- GenericAccessor.reduce()
- GenericAccessor.resample_apply()
- GenericAccessor.resample_between_bounds()
- GenericAccessor.resample_to_index()
- GenericAccessor.resolve_mapping()
- GenericAccessor.robust_scale()
- GenericAccessor.rolling_all()
- GenericAccessor.rolling_any()
- GenericAccessor.rolling_apply()
- GenericAccessor.rolling_corr()
- GenericAccessor.rolling_cov()
- GenericAccessor.rolling_idxmax()
- GenericAccessor.rolling_idxmin()
- GenericAccessor.rolling_max()
- GenericAccessor.rolling_mean()
- GenericAccessor.rolling_min()
- GenericAccessor.rolling_ols()
- GenericAccessor.rolling_pattern_similarity()
- GenericAccessor.rolling_prod()
- GenericAccessor.rolling_rank()
- GenericAccessor.rolling_std()
- GenericAccessor.rolling_sum()
- GenericAccessor.rolling_zscore()
- GenericAccessor.row_apply()
- GenericAccessor.scale()
- GenericAccessor.scatterplot()
- GenericAccessor.shuffle()
- GenericAccessor.squeeze_grouped()
- GenericAccessor.std()
- GenericAccessor.sum()
- GenericAccessor.to_daily_log_returns()
- GenericAccessor.to_daily_returns()
- GenericAccessor.to_log_returns()
- GenericAccessor.to_mapped()
- GenericAccessor.to_returns()
- GenericAccessor.transform()
- GenericAccessor.ts_heatmap()
- GenericAccessor.value_counts()
- GenericAccessor.vidya()
- GenericAccessor.volume()
- GenericAccessor.wm_mean()
- GenericAccessor.wwm_mean()
- GenericAccessor.wwm_std()
- GenericAccessor.zscore()
- GenericSRAccessor.fit_pattern()
- GenericSRAccessor.to_renko()
- GenericSRAccessor.to_renko_ohlc()
- HasSettings.get_path_setting()
- HasSettings.get_path_settings()
- HasSettings.get_setting()
- HasSettings.get_settings()
- HasSettings.has_path_setting()
- HasSettings.has_path_settings()
- HasSettings.has_setting()
- HasSettings.has_settings()
- HasSettings.reset_settings()
- HasSettings.resolve_setting()
- HasSettings.resolve_settings_paths()
- HasSettings.set_settings()
- PandasIndexer.xs()
- Pickleable.decode_config()
- Pickleable.decode_config_node()
- Pickleable.dumps()
- Pickleable.encode_config()
- Pickleable.encode_config_node()
- Pickleable.file_exists()
- Pickleable.getsize()
- Pickleable.load()
- Pickleable.loads()
- Pickleable.modify_state()
- Pickleable.resolve_file_path()
- Pickleable.save()
- PlotsBuilderMixin.build_subplots_doc()
- PlotsBuilderMixin.override_subplots_doc()
- PlotsBuilderMixin.plots()
- ReturnsAccessor.alpha()
- ReturnsAccessor.ann_factor
- ReturnsAccessor.ann_factor_to_year_freq()
- ReturnsAccessor.annual()
- ReturnsAccessor.annualized()
- ReturnsAccessor.annualized_volatility()
- ReturnsAccessor.auto_detect_ann_factor()
- ReturnsAccessor.beta()
- ReturnsAccessor.bm_returns
- ReturnsAccessor.calmar_ratio()
- ReturnsAccessor.capture_ratio()
- ReturnsAccessor.cls_dir
- ReturnsAccessor.column_only_select
- ReturnsAccessor.common_sense_ratio()
- ReturnsAccessor.cond_value_at_risk()
- ReturnsAccessor.config
- ReturnsAccessor.cumulative()
- ReturnsAccessor.daily()
- ReturnsAccessor.deannualize()
- ReturnsAccessor.defaults
- ReturnsAccessor.deflated_sharpe_ratio()
- ReturnsAccessor.df_accessor_cls
- ReturnsAccessor.down_capture_ratio()
- ReturnsAccessor.downside_risk()
- ReturnsAccessor.drawdown()
- ReturnsAccessor.drawdowns
- ReturnsAccessor.from_value()
- ReturnsAccessor.get_ann_factor()
- ReturnsAccessor.get_drawdowns()
- ReturnsAccessor.get_year_freq()
- ReturnsAccessor.group_select
- ReturnsAccessor.iloc
- ReturnsAccessor.indexing_func()
- ReturnsAccessor.indexing_kwargs
- ReturnsAccessor.information_ratio()
- ReturnsAccessor.loc
- ReturnsAccessor.log_returns
- ReturnsAccessor.mapping
- ReturnsAccessor.max_drawdown()
- ReturnsAccessor.obj
- ReturnsAccessor.omega_ratio()
- ReturnsAccessor.parse_ann_factor()
- ReturnsAccessor.plot_cumulative()
- ReturnsAccessor.plots_defaults
- ReturnsAccessor.prob_sharpe_ratio()
- ReturnsAccessor.profit_factor()
- ReturnsAccessor.qs
- ReturnsAccessor.range_only_select
- ReturnsAccessor.ranges
- ReturnsAccessor.rec_state
- ReturnsAccessor.resample()
- ReturnsAccessor.resample_returns()
- ReturnsAccessor.resolve_column_stack_kwargs()
- ReturnsAccessor.resolve_row_stack_kwargs()
- ReturnsAccessor.resolve_self()
- ReturnsAccessor.rolling_alpha()
- ReturnsAccessor.rolling_annualized()
- ReturnsAccessor.rolling_annualized_volatility()
- ReturnsAccessor.rolling_beta()
- ReturnsAccessor.rolling_calmar_ratio()
- ReturnsAccessor.rolling_capture_ratio()
- ReturnsAccessor.rolling_common_sense_ratio()
- ReturnsAccessor.rolling_cond_value_at_risk()
- ReturnsAccessor.rolling_down_capture_ratio()
- ReturnsAccessor.rolling_downside_risk()
- ReturnsAccessor.rolling_information_ratio()
- ReturnsAccessor.rolling_max_drawdown()
- ReturnsAccessor.rolling_omega_ratio()
- ReturnsAccessor.rolling_profit_factor()
- ReturnsAccessor.rolling_sharpe_ratio()
- ReturnsAccessor.rolling_sortino_ratio()
- ReturnsAccessor.rolling_tail_ratio()
- ReturnsAccessor.rolling_total()
- ReturnsAccessor.rolling_up_capture_ratio()
- ReturnsAccessor.rolling_value_at_risk()
- ReturnsAccessor.self_aliases
- ReturnsAccessor.sharpe_ratio()
- ReturnsAccessor.sharpe_ratio_std()
- ReturnsAccessor.sortino_ratio()
- ReturnsAccessor.sr_accessor_cls
- ReturnsAccessor.stats_defaults
- ReturnsAccessor.tail_ratio()
- ReturnsAccessor.total()
- ReturnsAccessor.up_capture_ratio()
- ReturnsAccessor.value_at_risk()
- ReturnsAccessor.wrapper
- ReturnsAccessor.xloc
- ReturnsAccessor.year_freq
- ReturnsAccessor.year_freq_depends_on_index()
- StatsBuilderMixin.build_metrics_doc()
- StatsBuilderMixin.override_metrics_doc()
- StatsBuilderMixin.stats()
- Wrapping.regroup()
- Wrapping.resolve_stack_kwargs()
- Wrapping.select_col()
- Wrapping.select_col_from_obj()
- Wrapping.split()

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings