portfolio_pipeline
| Name | Type | Default | Description |
|---|---|---|---|
data | vbt.Data | -- | The input data. |
s1 | str | -- | First symbol. |
s2 | str | -- | Second symbol. |
model_func | tp.Callable | -- | Function to compute model output. |
signal_func | tp.Callable | -- | Function to generate signals. |
long_entries | float | -- | Long entry signals. |
long_exits | float | -- | Long exit signals. |
short_entries | float | -- | Short entry signals. |
short_exits | float | -- | Short exit signals. |
preprocess_func | tp.Callable | None | Preprocessing function(s) to apply (default is None). |
metrics | str | None | Metrics to compute (default is None). |
use_close | bool | True | Whether to use ‘Close’ prices (default is True). |
size | float | 50 | Size of each order (default is 50). |
size_type | str | valuepercent100 | Type of size (default is “valuepercent100”). |
allow_partial | float | None | Whether to allow partial fills (default is None). |
fees | float | None | Fees per order (default is None). |
fixed_fees | float | None | Fixed fees per order (default is None). |
slippage | float | None | Slippage per order (default is None). |
min_size | float | None | Minimum size of each order (default is None). |
max_size | float | None | Maximum size of each order (default is None). |
size_granularity | float | None | Granularity of size (default is None). |
sl_stop | float | None | Stop-loss level (default is None). |
tsl_stop | float | None | Trailing stop-loss level (default is None). |
tp_stop | float | None | Take-profit level (default is None). |
accumulate | bool | None | Whether to accumulate orders (default is None). |
init_cash | float | None | Initial cash (default is None). |
cash_sharing | bool | True | Whether to share cash between assets (default is True). |
group_by | bool | True | Whether to group by symbol (default is True). |
call_seq | bool | auto | Call sequence (default is “auto”). |
fill_pos_info | bool | False | Whether to fill position info (default is False). |
log | bool | None | Whether to log orders (default is None). |
portfolio_kwargs | tp.Kwargs | None | Additional keyword arguments for the portfolio simulation. |
model_params | tp.Kwargs | -- | Additional parameters for model_func. |
| Type | Description |
|---|---|
vbt.Portfolio or float or tp.List[float] or tp.SeriesFrame | The result of the portfolio simulation. |
portfolio_pipeline_nb
| Name | Type | Default | Description |
|---|---|---|---|
open | tp.Array1d | -- | Open prices. |
high | tp.Array1d | -- | High prices. |
low | tp.Array1d | -- | Low prices. |
close | tp.Array1d | -- | Close prices. |
model_func_nb | tp.Callable | -- | Function to compute model output. |
metrics_func_nb | tp.Callable | -- | Function to compute metrics. |
signal_func_nb | tp.Callable | -- | Function to generate signals. |
long_entries | float | -1.0 | Long entry signals. Defaults to -1.0. |
long_exits | float | 0.0 | Long exit signals. Defaults to 0.0. |
short_entries | float | 1.0 | Short entry signals. Defaults to 1.0. |
short_exits | float | 0.0 | Short exit signals. Defaults to 0.0. |
preprocess_func_nb | tp.Callable | None | Preprocessing function(s) to apply. Defaults to None. |
size | int | -- | or float, default 50 Size of each order. Defaults to 50. |
sl_stop | float | np.nan | Stop-loss level. Defaults to np.nan. |
tsl_stop | float | np.nan | Trailing stop-loss level. Defaults to np.nan. |
tp_stop | float | np.nan | Take-profit level. Defaults to np.nan. |
| Type | Description |
|---|---|
tp.Any | The result of the portfolio simulation. |

