BaseComposer
Descendants
systematica.portfolio.composers.ColumnStackComposersystematica.portfolio.composers.Composersystematica.portfolio.composers.SignalComposer
Class variables
-
model_name: str: Name of the model to use. Should match to a model in systematica.api.models. -
portfolio_params: Dict[str, Any]: Additional keyword arguments for portfolio simulation. -
model_params: Dict[str, Any]: A dictionary of optional keyword arguments needed to compute the model.
Methods
run
| Name | Type | Default | Description |
|---|---|---|---|
data | vbt.Data | -- | Vector BT data object containing the input data. |
s1 | str | -- | First symbol or identifier for the data. |
s2 | str | -- | Second symbol or identifier for the data. |
portfolio_kwargs | tp.Kwargs | -- | Keyword arguments for portfolio configuration. |
kwargs | tp.Kwargs | -- | Additional keyword arguments passed to the model. |
| Type | Description |
|---|---|
PortfolioAnalyzer | Portfolio analyzer instance containing the results of the composition. |
BaseFrontier
MV: Standard Deviation.KT: Square Root of Kurtosis.MAD: Mean Absolute Deviation.GMD: Gini Mean Difference.MSV: Semi Standard Deviation.SKT: Square Root of Semi Kurtosis.FLPM: First Lower Partial Moment (Omega Ratio).SLPM: Second Lower Partial Moment (Sortino Ratio).CVaR: Conditional Value at Risk.TG: Tail Gini.EVaR: Entropic Value at Risk.RLVaR: Relativistic Value at Risk.WR: Worst Realization (Minimax).RG: Range of returns.CVRG: CVaR range of returns.TGRG: Tail Gini range of returns.EVRG: EVaR range of returns.RVRG: RLVaR range of returns. I recommend only use this function withMOSEKsolver.MDD: Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).ADD: Average Drawdown of uncompounded cumulative returns.CDaR: Conditional Drawdown at Risk of uncompounded cumulative returns.EDaR: Entropic Drawdown at Risk of uncompounded cumulative returns.RLDaR: Relativistic Drawdown at Risk of uncompounded cumulative returns.UCI: Ulcer Index of uncompounded cumulative returns.
Ancestors
abc.ABCriskfolio.src.Portfolio.Portfolio
Descendants
systematica.portfolio.frontiers.FrontierAssetStatssystematica.portfolio.frontiers.FrontierBLFactorsStatssystematica.portfolio.frontiers.FrontierBLStatssystematica.portfolio.frontiers.FrontierFactorsStatssystematica.portfolio.frontiers.FrontierWCStats
Class variables
-
alpha: float: Significance level ofVaR,CVaR,EVaR,RLVaR,DaR,CDaR,EDaR,RLDaRandTail Giniof losses. The default is0.05. -
a_sim: int: Number ofCVaRsused to approximateTail Giniof losses. The default is100. -
beta: float: Significance level ofCVaRandTail Giniof gains. IfNoneit duplicates alpha value. The default isNone. -
b_sim: int: Number of CVaRs used to approximate Tail Gini of gains. IfNoneit duplicatesa_simvalue. The default isNone. -
model: str: Methodology used to estimate input parameters. The default isClassic. -
rm: str: The risk measure used to optimize the portfolio. The default isMV. Possible values are displayed above. -
kelly: str: Method used to calculate mean return. Possible values are: None for arithmetic mean return, “approx” for approximate mean logarithmic return using first and second moment and “exact” for mean logarithmic return. The default is None. -
rf: float: Risk free rate. The default is0.0. -
hist: bool: Indicate what kind of returns are used to calculate risk measures that depends on scenarios (All exceptMVrisk measure). The default isTrue. If model =BL,Truemeans historical covariance and returns andFalseBlack Litterman covariance and historical returns. If model =FM,Truemeans historical covariance and returns and False Risk Factor model for covariance and returns. If model =BL_FM,Truemeans historical covariance and returns,FalseBlack Litterman with Risk Factor model for covariance and Risk Factor model for returns, and2Risk Factor model for covariance and returns. -
solver: str: Solver available forCVXPYthat supports power cone programming. Used to calculateRLVaRandRLDaR. The default value isCLARABEL. -
constraints: List[Dict[str, str]]: Risk contribution constraints. Defaults toNone. -
asset_classes: dict: Asset classes. -
config: Dict[str, Any]: Riskfolio-lib configuration. Overwrite other required parameters if referenced.
Instance variables
-
kappa: float: Deformation parameter ofRLVaRandRLDaRfor losses, must be between0and1. The default is0.30. -
freq: Infer the frequency of the returns index. -
ann_factor: Calculate the annualization factor based on the frequency. -
x_axis: str: Generate the label for the x-axis based on the risk measure. -
y_axis: str: Generate the label for the y-axis based on the Kelly criterion. -
z_axis: str: Generate the label for the z-axis.
Methods
init
| Name | Type | Default | Description |
|---|---|---|---|
market_returns | pd.DataFrame | -- | DataFrame containing market returns data. |
| Type | Description |
|---|---|
ValueError | If the cleaned market returns still contain NaN values. |
fit
| Name | Type | Default | Description |
|---|---|---|---|
market_returns | pd.DataFrame | -- | Market returns data. |
| Type | Description |
|---|---|
BaseFrontier | Fitted portfolio object. |
add_constraints
| Type | Description |
|---|---|
BaseFrontier | Portfolio object with added constraints. |
predict
| Name | Type | Default | Description |
|---|---|---|---|
points | int | 20 | Number of points to calculate on the frontier, by default 20. |
| Type | Description |
|---|---|
pd.DataFrame | DataFrame containing the efficient frontier. |
get_portfolio
| Name | Type | Default | Description |
|---|---|---|---|
weights | pd.Series | -- | Portfolio weights. |
| Type | Description |
|---|---|
pd.DataFrame | Target portfolio. |
get_efficient_frontier
| Name | Type | Default | Description |
|---|---|---|---|
points | int | 20 | Number of points to calculate on the frontier, by default 20. |
| Type | Description |
|---|---|
pd.DataFrame | Efficient frontier. |
plot_frontier
| Name | Type | Default | Description |
|---|---|---|---|
weights | pd.Series | -- | Portfolio weights. |
display_frontier | bool | True | Display frontier. Defaults to True. |
portfolio_name | str | Target... | Portfolio name. Defaults to “Target Portfolio”. |
marker_color | str | red | Color of the portfolio star shaped marker. Defaults to “red”. |
marker_size | int | 20 | Size of the portfolio star shaped marker. Default to 20. |
make_figure_kwargs | tp.KwargsLike | None | Additional figure arguments, by default None. |
fig | tp.BaseFigure | None | Existing figure to update, by default None. |
showscale | bool | True | Whether to show the scale, by default True. |
layout_kwargs | tp.Kwargs | -- | Additional layout arguments for the figure. |
| Type | Description |
|---|---|
vbt.FigureWidget | A Plotly FigureWidget containing the frontier plot. |

