> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyzer

> systematica.portfolio.analyzer

## `PortfolioAnalyzer`

```python theme={null}
PortfolioAnalyzer(
    data: vectorbtpro.data.base.Data,
    s1: str,
    s2: str,
    vbt: vectorbtpro.portfolio.base.Portfolio,
    model_output: pandas.core.frame.DataFrame | numpy.ndarray = None,
    window: int = None,
    minp: int = None,
)
```

A class representing a portfolio analyzer: Analyzes post-simulation
backtest and inherites from `vbt.Portfolio`.

Method generated by attrs for class PortfolioAnalyzer.

### Class variables

* `data: vectorbtpro.data.base.Data`: Data object.

* `s1: str`: First symbol.

* `s2: str`: Second symbol.

* `vbt: vectorbtpro.portfolio.base.Portfolio`: VectorBT PRO Portfolio object.

* `model_output: pandas.core.frame.DataFrame | numpy.ndarray`: Model output used in the strategy. Defaults to `None`.

* `window: int`: Rolling window used in the model. Defaults to `None`.

* `minp: int`: Minimum number of observations required in the model. Defaults to `None`.

### Instance variables

* `freq: pandas._libs.tslibs.timedeltas.Timedelta`: Get the frequency of the data.

* `column_wrapper: List[str]`: Get the column wrapper for the portfolio.  If MultiIndex (where group\_by is `False`), Get the first level only.

* `categories: pandas.core.frame.DataFrame | None`: Retrieve asset categories.

* `drawdowns_readable`: Get the drawdowns of the portfolio.

* `pfo: vectorbtpro.portfolio.pfopt.base.PortfolioOptimizer`: Pick allocations from an already filled array.

* `pfo_allocations: pandas.core.frame.DataFrame`: Get the portfolio allocations.

* `latest_allocation: pandas.core.frame.DataFrame`: Get the latest allocation of the portfolio.

* `current_holdings`: Get the current holdings of the portfolio.

* `pfo_describe: pandas.core.frame.DataFrame`: Get descriptive statistics of portfolio allocations.

* `average_allocation`: Get the average allocation of the portfolio.

* `allocation_records_readable`: Get readable allocation records.

* `latest_allocation_records`: Get the latest allocation records.

### Methods

#### `get_signals`

```python theme={null}
get_signals(
    self,
    start: str | float | int | complex | bool | object | numpy.generic | Sequence[str | float | int | complex | bool | object | numpy.generic] | Sequence[Sequence[Any]] | vectorbtpro._typing.SupportsArrayT | numpy.ndarray = None,
    end: str | float | int | complex | bool | object | numpy.generic | Sequence[str | float | int | complex | bool | object | numpy.generic] | Sequence[Sequence[Any]] | vectorbtpro._typing.SupportsArrayT | numpy.ndarray = None,
    group_by: bool = False,
) ‑> systematica.signals.base.Signals
```

Return signals for long and short entries and exits.

Compute boolean signals indicating the occurrence of long entry orders,
long exit orders, short entry orders, and short exit orders.

Signals are computed per group if grouping is enabled. Pass
`group_by=False` to disable grouping.

**Parameters**:

| Name       | Type        | Default | Description                          |
| ---------- | ----------- | ------- | ------------------------------------ |
| `start`    | `ArrayLike` | `None`  | Start index of the simulation range. |
| `end`      | `ArrayLike` | `None`  | End index of the simulation range.   |
| `group_by` | `bool`      | `False` | Grouping specification.              |

**Returns**:

| Type      | Description                           |
| --------- | ------------------------------------- |
| `Signals` | systematica Signals namedtuple class. |

#### `get_market_returns`

```python theme={null}
get_market_returns(
    self,
) ‑> pandas.core.frame.DataFrame
```

Calculate market returns without NaNs.

**Returns**:

| Type           | Description                  |
| -------------- | ---------------------------- |
| `pd.DataFrame` | DataFrame of market returns. |

#### `get_pf_metrics`

```python theme={null}
get_pf_metrics(
    self,
    metrics: str | List[str],
    to_dict: bool = False,
    to_numpy: bool = False,
    **kwargs,
) ‑> pandas.core.frame.DataFrame
```

Get performance metrics from a backtested portfolio.

**Parameters**:

| Name       | Type        | Default | Description                                                                                                                                                                                                                                         |
| ---------- | ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `metrics`  | `str`       | `--`    | or list of str A single metric key or a list of metric keys to look up in the registry.                                                                                                                                                             |
| `to_dict`  | `bool`      | `False` | Change frame format output to dict type if set to `False`. Raw `pd.DataFrame` object data otherwise. Frames are retrieve when group\_by is `False` in the `vbt.PF` configuration and/or when rolling calculation is triggered. Defaults to `False`. |
| `to_numpy` | `bool`      | `False` | If False, returns a pandas DataFrame. Otherwise a numpy array.                                                                                                                                                                                      |
| `kwargs`   | `tp.Kwargs` | `--`    | Additional key-word arguments passed to `Metric.run_pf_metric`.                                                                                                                                                                                     |

**Returns**:

| Type                                                                         | Description                               |
| ---------------------------------------------------------------------------- | ----------------------------------------- |
| `pd.DataFrame`                                                               | DataFrame containing performance metrics. |
| `Example`                                                                    |                                           |
| `-------`                                                                    |                                           |
| `With a `pf` object:`                                                        |                                           |
| \`\`\`\`python\`                                                             |                                           |
| `>>> model.get_performance_output(pd, metrics='sharpe_ratio')`               |                                           |
| \`\`\`\`\`                                                                   |                                           |
| `With a parameterized `pf` object:`                                          |                                           |
| \`\`\`\`python\`                                                             |                                           |
| `>>> opt_results = model.get_performance_output(pd, metrics='sharpe_ratio')` |                                           |
| `>>> opt_results['sharpe_ratio'].vbt.histplot().show()`                      |                                           |
| \`\`\`\`\`                                                                   |                                           |

#### `get_rolling_metrics`

```python theme={null}
get_rolling_metrics(
    self,
    metrics: str | List[str],
    window: int = None,
    minp: int = None,
    to_numpy: bool = False,
    **kwargs,
) ‑> pandas.core.frame.DataFrame | numpy.ndarray
```

Get rolling metrics.

**Parameters**:

| Name       | Type        | Default | Description                                                          |
| ---------- | ----------- | ------- | -------------------------------------------------------------------- |
| `metrics`  | `str`       | `--`    | Metric to  compute                                                   |
| `window`   | `int`       | `None`  | Rolling window length. The default is `None`.                        |
| `minp`     | `int`       | `None`  | Mininum periods. The default is `None`.                              |
| `to_numpy` | `bool`      | `False` | Output numpy array if True. The default is `False`.                  |
| `kwargs`   | `tp.Kwargs` | `--`    | Additional key-word arguments passed to `Metric.run_rolling_metric`. |

**Raises**:

| Type         | Description                              |
| ------------ | ---------------------------------------- |
| `ValueError` | if parameter window is to be specified.. |

**Returns**:

| Type                       | Description      |
| -------------------------- | ---------------- |
| `pd.DataFrame \| tp.Array` | Rolling metrics. |

#### `all_stats`

```python theme={null}
all_stats(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    portfolio: Dict[str, Any] = None,
    drawdowns: Dict[str, Any] = None,
) ‑> pandas.core.series.Series
```

Get all statistics of the portfolio.

**Parameters**:

| Name        | Type        | Default | Description                                                        |
| ----------- | ----------- | ------- | ------------------------------------------------------------------ |
| `start`     | `str`       | `None`  | The start date. Defaults to `None`.                                |
| `end`       | `str`       | `None`  | The end date. Defaults to `None`.                                  |
| `portfolio` | `tp.Kwargs` | `None`  | Addtional arguments for `vbt.stats`. Defaults to `None`.           |
| `drawdowns` | `tp.Kwargs` | `None`  | Addtional arguments for `vbt.drawdowns.stats`. Defaults to `None`. |

**Returns**:

| Type        | Description                                                      |
| ----------- | ---------------------------------------------------------------- |
| `pd.Series` | All portfolio, returns, orders, trades and drawdowns statistics. |

#### `plot_rolling_metrics`

```python theme={null}
plot_rolling_metrics(
    self,
    metrics: str | List[str],
    window: int,
    minp: int = None,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot rolling metrics.

**Parameters**:

| Name            | Type        | Default | Description                                                            |
| --------------- | ----------- | ------- | ---------------------------------------------------------------------- |
| `metrics`       | `str`       | `--`    | Metric to  compute                                                     |
| `window`        | `int`       | `None`  | Rolling window length. The default is `None`.                          |
| `minp`          | `int`       | `None`  | Mininum periods. The default is `None`.                                |
| `layout_kwargs` | `tp.Kwargs` | `--`    | Additional layout keyword arguments passed to `vbt.FigureWidget.plot`. |

**Returns**:

| Type               | Description                          |
| ------------------ | ------------------------------------ |
| `vbt.FigureWidget` | Figure widget of the rolling metric. |

#### `plot_equity_curve`

```python theme={null}
plot_equity_curve(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    bm_returns: bool = False,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the equity curve of the portfolio.

**Parameters**:

| Name            | Type        | Default | Description                                                |
| --------------- | ----------- | ------- | ---------------------------------------------------------- |
| `start`         | `str`       | `None`  | The start date. Defaults to `None`.                        |
| `end`           | `str`       | `None`  | The end date. Defaults to `None`.                          |
| `bm_returns`    | `bool`      | `False` | Whether to include benchmark returns. Defaults to `False`. |
| `layout_kwargs` | `tp.Kwargs` | `--`    | Additional layout keyword arguments.                       |

**Returns**:

| Type               | Description                        |
| ------------------ | ---------------------------------- |
| `vbt.FigureWidget` | Figure widget of the equity curve. |

#### `plot_performance_pnl`

```python theme={null}
plot_performance_pnl(
    self,
    symbol: str,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    group_by: bool = False,
    pct_scale=False,
    marker_size_range=(7, 14),
    opacity_range=(0.75, 0.9),
    closed_trace_kwargs=None,
    closed_profit_trace_kwargs=None,
    closed_loss_trace_kwargs=None,
    open_trace_kwargs=None,
    hline_shape_kwargs=None,
    add_trace_kwargs=None,
    xref='x',
    yref='y',
    fig=None,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the performance PnL of the portfolio.

**Parameters**:

| Name                         | Type               | Default      | Description                                        |
| ---------------------------- | ------------------ | ------------ | -------------------------------------------------- |
| `symbol`                     | `str`              | `--`         | Symbol to plot.                                    |
| `start`                      | `str`              | `None`       | The start date. Defaults to `None`.                |
| `end`                        | `str`              | `None`       | The end date. Defaults to `None`.                  |
| `group_by`                   | `bool`             | `False`      | Whether to group by. Defaults to False.            |
| `pct_scale`                  | `bool`             | `False`      | Whether to scale by percentage. Defaults to False. |
| `marker_size_range`          | `tuple`            | \`\`(7,\`    | 14)\` Range of marker sizes. Defaults to (7, 14).  |
| `opacity_range`              | `tuple`            | \`\`(0.75,\` | 0.9)\` Range of opacity. Defaults to (0.75, 0.9).  |
| `closed_trace_kwargs`        | `dict`             | `None`       | Keyword arguments for closed trace.                |
| `closed_profit_trace_kwargs` | `dict`             | `None`       | Keyword arguments for closed profit trace.         |
| `closed_loss_trace_kwargs`   | `dict`             | `None`       | Keyword arguments for closed loss trace.           |
| `open_trace_kwargs`          | `dict`             | `None`       | Keyword arguments for open trace.                  |
| `hline_shape_kwargs`         | `dict`             | `None`       | Keyword arguments for horizontal line shape.       |
| `add_trace_kwargs`           | `dict`             | `None`       | Keyword arguments for adding trace.                |
| `xref`                       | `str`              | `x`          | X reference. Defaults to `x`.                      |
| `yref`                       | `str`              | `y`          | Y reference. Defaults to `y`.                      |
| `fig`                        | `vbt.FigureWidget` | `None`       | Existing figure widget.                            |
| `layout_kwargs`              | `tp.Kwargs`        | `--`         | Additional layout keyword arguments.               |

**Returns**:

| Type               | Description                           |
| ------------------ | ------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the performance PnL. |

#### `plot_running_edge_ratio`

```python theme={null}
plot_running_edge_ratio(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    volatility: bool = None,
    entry_price_open: bool = False,
    exit_price_close: bool = False,
    max_duration: int = None,
    incl_shorter: bool = False,
    group_by: str = None,
    jitted: bool = None,
    xref: str = 'x',
    yref: str = 'y',
    hline_shape_kwargs: Dict[str, Any] = None,
    **kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the running edge ratio of the portfolio.

**Parameters**:

| Name                 | Type        | Default | Description                                              |
| -------------------- | ----------- | ------- | -------------------------------------------------------- |
| `start`              | `str`       | `None`  | The start date. Defaults to `None`.                      |
| `end`                | `str`       | `None`  | The end date. Defaults to `None`.                        |
| `volatility`         | `float`     | `None`  | Volatility value.                                        |
| `entry_price_open`   | `bool`      | `False` | Whether to use entry price open. Defaults to False.      |
| `exit_price_close`   | `bool`      | `False` | Whether to use exit price close. Defaults to False.      |
| `max_duration`       | `int`       | `None`  | Maximum duration.                                        |
| `incl_shorter`       | `bool`      | `False` | Whether to include shorter durations. Defaults to False. |
| `group_by`           | `str`       | `None`  | Group by value.                                          |
| `jitted`             | `bool`      | `None`  | Whether to use jitted mode. Defaults to `None`.          |
| `xref`               | `str`       | `x`     | X reference. Defaults to `x`.                            |
| `yref`               | `str`       | `y`     | Y reference. Defaults to `y`.                            |
| `hline_shape_kwargs` | `dict`      | `None`  | Keyword arguments for horizontal line shape.             |
| `kwargs`             | `tp.Kwargs` | `--`    | Additional keyword arguments.                            |

**Returns**:

| Type               | Description                              |
| ------------------ | ---------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the running edge ratio. |

#### `plot_performance_reset`

```python theme={null}
plot_performance_reset(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    by: str = 'Y',
    add_close: bool = True,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the performance reset of the portfolio.

**Parameters**:

| Name        | Type   | Default | Description                                    |
| ----------- | ------ | ------- | ---------------------------------------------- |
| `start`     | `str`  | `None`  | The start date. Defaults to `None`.            |
| `end`       | `str`  | `None`  | The end date. Defaults to `None`.              |
| `by`        | `str`  | `Y`     | Reset by value. Defaults to `Y`.               |
| `add_close` | `bool` | `True`  | Whether to add close prices. Defaults to True. |

**Returns**:

| Type               | Description                             |
| ------------------ | --------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the performance reset. |

#### `plot_performance_rebase`

```python theme={null}
plot_performance_rebase(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    add_close: bool = True,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the performance rebase of the portfolio.

**Parameters**:

| Name        | Type   | Default | Description                                    |
| ----------- | ------ | ------- | ---------------------------------------------- |
| `start`     | `str`  | `None`  | The start date. Defaults to `None`.            |
| `end`       | `str`  | `None`  | The end date. Defaults to `None`.              |
| `add_close` | `bool` | `True`  | Whether to add close prices. Defaults to True. |

**Returns**:

| Type               | Description                              |
| ------------------ | ---------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the performance rebase. |

#### `plot_performance_matrix`

```python theme={null}
plot_performance_matrix(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the performance matrix of the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                         |
| ------------- | ----------- | ------- | ----------------------------------- |
| `start`       | `str`       | `None`  | The start date. Defaults to `None`. |
| `end`         | `str`       | `None`  | The end date. Defaults to `None`.   |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional plot keyword arguments.  |

**Returns**:

| Type               | Description                              |
| ------------------ | ---------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the performance matrix. |

#### `plot_drawdown_and_underwater`

```python theme={null}
plot_drawdown_and_underwater(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    pct_scale: bool = False,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the drawdowns of the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                                       |
| ------------- | ----------- | ------- | ------------------------------------------------- |
| `start`       | `str`       | `None`  | The start date. Defaults to `None`.               |
| `end`         | `str`       | `None`  | The end date. Defaults to `None`.                 |
| `pct_scale`   | `bool`      | `s`     | to `False` Percentage scale. Defaults to `False`. |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional plot keyword arguments.                |

**Returns**:

| Type               | Description                     |
| ------------------ | ------------------------------- |
| `vbt.FigureWidget` | Figure widget of the drawdowns. |

#### `plot_allocation_report`

```python theme={null}
plot_allocation_report(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    column: Hashable = None,
    dropna: str = 'head',
    line_shape: str = 'hv',
    plot_rb_dates: bool = None,
    trace_kwargs: Dict[str, Any] | Sequence[Dict[str, Any] | None] | None = None,
    add_shape_kwargs: Dict[str, Any] | None = None,
    add_trace_kwargs: Dict[str, Any] | None = None,
    fig: plotly.basedatatypes.BaseFigure = None,
    group_by_category: bool = False,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the allocations of the portfolio.

**Parameters**:

| Name                | Type               | Default | Description                                      |
| ------------------- | ------------------ | ------- | ------------------------------------------------ |
| `start`             | `str`              | `None`  | The start date. Defaults to `None`.              |
| `end`               | `str`              | `None`  | The end date. Defaults to `None`.                |
| `column`            | `tp.Label`         | `None`  | Column to plot.                                  |
| `dropna`            | `str`              | `head`  | Drop NaN values. Defaults to `head`.             |
| `line_shape`        | `str`              | `hv`    | Line shape. Defaults to `hv`.                    |
| `plot_rb_dates`     | `bool`             | `None`  | Whether to plot rebalancing dates.               |
| `trace_kwargs`      | `dict`             | `None`  | Keyword arguments for trace.                     |
| `add_shape_kwargs`  | `dict`             | `None`  | Keyword arguments for adding shape.              |
| `add_trace_kwargs`  | `dict`             | `None`  | Keyword arguments for adding trace.              |
| `fig`               | `vbt.FigureWidget` | `None`  | Existing figure widget.                          |
| `group_by_category` | `bool`             | `False` | Whether to group by category. Defaults to False. |
| `layout_kwargs`     | `tp.Kwargs`        | `--`    | Additional layout keyword arguments.             |

**Returns**:

| Type               | Description                       |
| ------------------ | --------------------------------- |
| `vbt.FigureWidget` | Figure widget of the allocations. |

#### `plot_pie_allocation`

```python theme={null}
plot_pie_allocation(
    self,
    rp_kwargs: Dict[str, Any] | None = None,
    trace_kwargs: Dict[str, Any] | Sequence[Dict[str, Any] | None] | None = None,
    add_trace_kwargs: Dict[str, Any] | None = None,
    make_figure_kwargs: Dict[str, Any] | None = None,
    fig: ForwardRef('plotly.basedatatypes.BaseFigure') | None = None,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the pie chart of the latest allocation.

**Parameters**:

| Name                 | Type               | Default | Description                              |
| -------------------- | ------------------ | ------- | ---------------------------------------- |
| `rp_kwargs`          | `dict`             | `None`  | Keyword arguments for radial plot.       |
| `trace_kwargs`       | `dict`             | `None`  | Keyword arguments for trace.             |
| `add_trace_kwargs`   | `dict`             | `None`  | Keyword arguments for adding trace.      |
| `make_figure_kwargs` | `dict`             | `None`  | Keyword arguments for making the figure. |
| `fig`                | `vbt.FigureWidget` | `None`  | Existing figure widget.                  |
| `layout_kwargs`      | `tp.Kwargs`        | `--`    | Additional layout keyword arguments.     |

**Returns**:

| Type               | Description                     |
| ------------------ | ------------------------------- |
| `vbt.FigureWidget` | Figure widget of the pie chart. |

#### `plot_average_allocation`

```python theme={null}
plot_average_allocation(
    self,
    rp_kwargs: Dict[str, Any] | None = None,
    trace_kwargs: Dict[str, Any] | Sequence[Dict[str, Any] | None] | None = None,
    add_trace_kwargs: Dict[str, Any] | None = None,
    make_figure_kwargs: Dict[str, Any] | None = None,
    fig: ForwardRef('plotly.basedatatypes.BaseFigure') | None = None,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the pie chart of the average allocation.

**Parameters**:

| Name                 | Type               | Default | Description                              |
| -------------------- | ------------------ | ------- | ---------------------------------------- |
| `rp_kwargs`          | `dict`             | `None`  | Keyword arguments for radial plot.       |
| `trace_kwargs`       | `dict`             | `None`  | Keyword arguments for trace.             |
| `add_trace_kwargs`   | `dict`             | `None`  | Keyword arguments for adding trace.      |
| `make_figure_kwargs` | `dict`             | `None`  | Keyword arguments for making the figure. |
| `fig`                | `vbt.FigureWidget` | `None`  | Existing figure widget.                  |
| `layout_kwargs`      | `tp.Kwargs`        | `--`    | Additional layout keyword arguments.     |

**Returns**:

| Type               | Description                     |
| ------------------ | ------------------------------- |
| `vbt.FigureWidget` | Figure widget of the pie chart. |

#### `plot_cash_report`

```python theme={null}
plot_cash_report(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the cash balance of the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                         |
| ------------- | ----------- | ------- | ----------------------------------- |
| `start`       | `str`       | `None`  | The start date. Defaults to `None`. |
| `end`         | `str`       | `None`  | The end date. Defaults to `None`.   |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional plot keyword arguments.  |

**Returns**:

| Type               | Description                        |
| ------------------ | ---------------------------------- |
| `vbt.FigureWidget` | Figure widget of the cash balance. |

#### `plot_excursions`

```python theme={null}
plot_excursions(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    expanding: bool = True,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trade excursions for a portfolio.

This function visualizes Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE)
for each trade in the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                                            |
| ------------- | ----------- | ------- | ------------------------------------------------------ |
| `start`       | `str`       | `None`  | The start date. Defaults to `None`.                    |
| `end`         | `str`       | `None`  | The end date. Defaults to `None`.                      |
| `expanding`   | `bool`      | `True`  | Whether to plot expanding MAE/MFE. Defaults to `True`. |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional plot keyword arguments.                     |

**Returns**:

| Type               | Description                                |
| ------------------ | ------------------------------------------ |
| `vbt.FigureWidget` | Figure widget of the expanding excursions. |

#### `plot_trades_by_symbol`

```python theme={null}
plot_trades_by_symbol(
    self,
    symbol: str,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the trades of the portfolio by symbol.

**Parameters**:

| Name     | Type  | Default | Description                         |
| -------- | ----- | ------- | ----------------------------------- |
| `symbol` | `str` | `--`    | Symbol to plot.                     |
| `start`  | `str` | `None`  | The start date. Defaults to `None`. |
| `end`    | `str` | `None`  | The end date. Defaults to `None`.   |

**Returns**:

| Type               | Description                            |
| ------------------ | -------------------------------------- |
| `vbt.FigureWidget` | Figure widget of the trades by symbol. |

#### `plot_all_trades`

```python theme={null}
plot_all_trades(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot all trades of the portfolio.

**Parameters**:

| Name            | Type        | Default | Description                          |
| --------------- | ----------- | ------- | ------------------------------------ |
| `start`         | `str`       | `None`  | The start date. Defaults to `None`.  |
| `end`           | `str`       | `None`  | The end date. Defaults to `None`.    |
| `layout_kwargs` | `tp.Kwargs` | `--`    | Additional layout keyword arguments. |

**Returns**:

| Type               | Description                  |
| ------------------ | ---------------------------- |
| `vbt.FigureWidget` | Figure widget of all trades. |

#### `plot_dashboard`

```python theme={null}
plot_dashboard(
    self,
    start: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    end: str | pandas._libs.tslibs.timestamps.Timestamp = None,
    showlegend: bool = False,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot the dashboard of the portfolio.

**Parameters**:

| Name            | Type           | Default | Description                          |
| --------------- | -------------- | ------- | ------------------------------------ |
| `start`         | `str`          | `None`  | The start date. Defaults to `None`.  |
| `end`           | `pd.Timestamp` | `None`  | The end date. Defaults to `None`.    |
| `showlegend`    | `bool`         | `False` | Show legend. Defaults to False.      |
| `layout_kwargs` | `tp.Kwargs`    | `--`    | Additional layout keyword arguments. |

**Returns**:

| Type               | Description                     |
| ------------------ | ------------------------------- |
| `vbt.FigureWidget` | Figure widget of the dashboard. |
