Skip to main content

RegressionLine

RegressionLine(
    data: pandas.core.frame.DataFrame | numpy.ndarray = None,
    x_labels: Sequence[Hashable] = None,
    trace_names: str | Sequence[str | None| 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: plotly.basedatatypes.BaseFigure = None,
    use_gl: bool = None,
    **layout_kwargs,
)
Create a regression line plot. Inherites from vbt.Scatter. Parameters:
NameTypeDefaultDescription
datapd.DataFrame--Data in any format that can be converted to NumPy. Must be of shape (x_labels, trace_names).
x_labelstp.LabelsNoneLabels for the x-axis. Must be of shape (data.shape[0],).
trace_namestp.TraceNamesNoneTrace names, corresponding to columns in pandas. Must be of shape (data.shape[1],).
trace_kwargstp.KwargsLikeSequenceNoneKeyword arguments passed to plotly.graph_objects.Scatter. Can be specified per trace as a sequence of dicts.
add_trace_kwargstp.KwargsLikeNoneKeyword arguments passed to add_trace.
make_figure_kwargstp.KwargsLikeNoneKeyword arguments passed to vectorbtpro.utils.figure.make_figure.
figtp.BaseFigureNoneFigure to add traces to.
use_glboolNoneWhether to use WebGL for rendering. If None, it will be set to True if the data is large enough, otherwise False.
layout_kwargstp.Kwargs--Keyword arguments for layout.

Ancestors

  • vectorbtpro.generic.plotting.Scatter
  • vectorbtpro.generic.plotting.TraceType
  • vectorbtpro.utils.config.Configured
  • vectorbtpro.utils.config.HasSettings
  • vectorbtpro.utils.caching.Cacheable
  • vectorbtpro.utils.checks.Comparable
  • vectorbtpro.utils.pickling.Pickleable
  • vectorbtpro.utils.formatting.Prettified
  • vectorbtpro.utils.chaining.Chainable
  • vectorbtpro.generic.plotting.TraceUpdater
  • vectorbtpro.utils.base.Base

TargetPortfolio

TargetPortfolio(
    data: pandas.core.series.Series = None,
    trace_names: str | Sequence[str | None| 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: plotly.basedatatypes.BaseFigure = None,
    use_gl: bool = None,
    **layout_kwargs,
)
Create a target portfolio plot. Inherites from vbt.Scatter. Parameters:
NameTypeDefaultDescription
datapd.SeriesNoneData in any format that can be converted to pandas Series. Must be of shape (trace_names,).
trace_namestp.TraceNamesNoneTrace names, corresponding to columns in pandas. Must be of shape (data.shape[0],).
trace_kwargstp.KwargsLikeSequenceNoneKeyword arguments passed to plotly.graph_objects.Scatter. Can be specified per trace as a sequence of dicts.
add_trace_kwargstp.KwargsLikeNoneKeyword arguments passed to add_trace.
make_figure_kwargstp.KwargsLikeNoneKeyword arguments passed to vectorbtpro.utils.figure.make_figure.
figtp.BaseFigureNoneFigure to add traces to.
use_glboolNoneWhether to use WebGL for rendering. If None, it will be set to True if the data is large enough, otherwise False.
layout_kwargstp.Kwargs--Keyword arguments for layout.

Ancestors

  • vectorbtpro.generic.plotting.Scatter
  • vectorbtpro.generic.plotting.TraceType
  • vectorbtpro.utils.config.Configured
  • vectorbtpro.utils.config.HasSettings
  • vectorbtpro.utils.caching.Cacheable
  • vectorbtpro.utils.checks.Comparable
  • vectorbtpro.utils.pickling.Pickleable
  • vectorbtpro.utils.formatting.Prettified
  • vectorbtpro.utils.chaining.Chainable
  • vectorbtpro.generic.plotting.TraceUpdater
  • vectorbtpro.utils.base.Base

Frontier

Frontier(
    data: pandas.core.series.Series = None,
    trace_names: str | Sequence[str | None| 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: plotly.basedatatypes.BaseFigure = None,
    use_gl: bool = None,
    **layout_kwargs,
)
Create a frontier plot. Inherits from vbt.Scatter. Parameters:
NameTypeDefaultDescription
datapd.SeriesNoneData in any format that can be converted to pandas Series. Must be of shape (trace_names,).
trace_namestp.TraceNamesNoneTrace names, corresponding to columns in pandas. Must be of shape (data.shape[0],).
trace_kwargstp.KwargsLikeSequenceNoneKeyword arguments passed to plotly.graph_objects.Scatter. Can be specified per trace as a sequence of dicts.
add_trace_kwargstp.KwargsLikeNoneKeyword arguments passed to add_trace.
make_figure_kwargstp.KwargsLikeNoneKeyword arguments passed to vectorbtpro.utils.figure.make_figure.
figtp.BaseFigureNoneFigure to add traces to.
use_glboolNoneWhether to use WebGL for rendering. If None, it will be set to True if the data is large enough, otherwise False.
layout_kwargstp.Kwargs--Keyword arguments for layout.

Ancestors

  • vectorbtpro.generic.plotting.Scatter
  • vectorbtpro.generic.plotting.TraceType
  • vectorbtpro.utils.config.Configured
  • vectorbtpro.utils.config.HasSettings
  • vectorbtpro.utils.caching.Cacheable
  • vectorbtpro.utils.checks.Comparable
  • vectorbtpro.utils.pickling.Pickleable
  • vectorbtpro.utils.formatting.Prettified
  • vectorbtpro.utils.chaining.Chainable
  • vectorbtpro.generic.plotting.TraceUpdater
  • vectorbtpro.utils.base.Base

Pie

Pie(
    data: pandas.core.frame.DataFrame | numpy.ndarray = None,
    rp_kwargs: Dict[str, Any] = None,
    trace_names: str | Sequence[str | None| 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: plotly.basedatatypes.BaseFigure = None,
    **layout_kwargs,
)
Create a bar plot. Inherits from vbt.Configured and vbt.TraceUpdater. Parameters:
NameTypeDefaultDescription
datatp.ArrayNoneData in any format that can be converted to NumPy. Must be of shape (trace_names).
rp_kwargstp.KwargsNoneKeyword arguments for vectorbtpro.portfolio.utils.rp. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
trace_namestp.TraceNamesNoneTrace names, corresponding to columns in pandas. Must be of shape (data.shape[0],) if data is not None. If data is None, it must be of shape (trace_names,). If trace_names is a string, it will be used as the name for all traces.
trace_kwargstp.KwargsLikeSequenceNoneKeyword arguments passed to plotly.graph_objects.Pie. Can be specified per trace as a sequence of dicts. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
add_trace_kwargstp.KwargsLikeNoneKeyword arguments passed to add_trace. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
make_figure_kwargstp.KwargsLikeNoneKeyword arguments passed to vectorbtpro.utils.figure.make_figure. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
figtp.BaseFigureNoneFigure to add traces to. If None, a new figure will be created. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
layout_kwargstp.KwargsNoneKeyword arguments for layout. If data is not None, it will be used to compute the portfolio. If data is None, it will be used to compute the portfolio from trace_names.
Examples:
>>> import numpy as np
>>> import systematica as sma
>>> pie = sma.Pie(
...     data=np.array([0.06, 0.02, 0.05, 0.09]),
...     trace_names=['SPY', 'TLT', 'XLF', 'XLE'],
... )
>>> pie.fig.show()

Ancestors

  • vectorbtpro.utils.config.Configured
  • vectorbtpro.utils.config.HasSettings
  • vectorbtpro.utils.caching.Cacheable
  • vectorbtpro.utils.checks.Comparable
  • vectorbtpro.utils.pickling.Pickleable
  • vectorbtpro.utils.formatting.Prettified
  • vectorbtpro.utils.chaining.Chainable
  • vectorbtpro.generic.plotting.TraceUpdater
  • vectorbtpro.utils.base.Base

Static methods

update_trace

update_trace(
    trace: plotly.basedatatypes.BaseTraceType,
    data: numpy.ndarray,
)
Update the trace with new data. Parameters:
NameTypeDefaultDescription
traceBaseTraceType--Trace to update.
datatp.Array1d--Data in any format that can be converted to NumPy. Must be of shape (trace_names,).

Methods

update

update(
    self,
    data: numpy.ndarray,
)
Update the plot with new data. Parameters:
NameTypeDefaultDescription
datatp.ArrayLike--Data in any format that can be converted to NumPy. Must be of shape (trace_names,).