Skip to main content

TradeScheduler

TradeScheduler(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    bfc_schema_kwargs: Dict[str, Any] = _Nothing.NOTHING,
    messenger: systematica.portfolio.messengers.base.BaseMessenger = None,
    max_buffer: int = 120,
    trading_url: str = 'https://pm-vpc.bfcdev.com/api/trade-signal',
    logger: systematica.utils.logger.Logger = None,
)
Workflow for managing strategy execution and data updates. Method generated by attrs for class TradeScheduler.

Ancestors

  • systematica.portfolio.schedulers.base.BaseScheduler
  • abc.ABC

Class variables

  • template: str: Template name.
  • loader_cls: vectorbtpro.data.base.Data: Loader class.
  • loader_params: Dict[str, Any]: Loader parameters.
  • model_cls: Any: Model strategy.
  • all_params: Dict[str, Any]: Model Parameters.
  • bfc_schema_kwargs: Dict[str, Any]: Additional BFC schema parameters.
  • messenger: systematica.portfolio.messengers.base.BaseMessenger: Custom messenger. Defaults to None.
  • max_buffer: int: Maximum buffer in seconds. If the last data point is older than the buffer, the data is considered outdated.
  • trading_url: str: Trading url.
  • logger: systematica.utils.logger.Logger: Custom logger.

Instance variables

  • timestamp: pandas._libs.tslibs.timestamps.Timestamp: Get the next timestamp.

Methods

check_data

check_data(
    self,
    data: vectorbtpro.data.base.Data,
) ‑> Tuple[vectorbtpro.data.base.Data, bool]
Check data update. Parameters:
NameTypeDefaultDescription
datavbt.Data--Data instance.
Returns:
TypeDescription
data : vbt.DataUpdated data instance.
is_updated : boolFlag to check in line with timestamp.

execute

execute(
    self,
)
Posts a trading signal to the server. This method updates the data, runs the pipeline, and generates trade signals. It then checks if the latest row in any of the entry or exit signals has any True values. Finally, it posts generated signals to the server.