Skip to main content

BaseScheduler

BaseScheduler()
Base Report scheduler analytics.

Ancestors

  • abc.ABC

Descendants

  • systematica.tools.schedulers.reports.ReportScheduler
  • systematica.tools.schedulers.trades.TradeScheduler

Static methods

pull_data

pull_data(
    loader: vectorbtpro.data.base.Data,
    params: Dict[str, Any],
) ‑> vectorbtpro.data.base.Data
Pull data. Parameters:
NameTypeDefaultDescription
loadervbt.Data--Loader class.
paramstp.Kwargs--Loader parameters.
Returns:
TypeDescription
vbt.DataA vbt.Data object containing historical data for each symbol.

update_data

update_data(
    data: vectorbtpro.data.base.Data,
    freq: str = None,
) ‑> vectorbtpro.data.base.Data
Update data. Fetches new data for each feature/symbol. Parameters:
NameTypeDefaultDescription
datavbt.Data--Current data object.
freqstr--Frequency to resample data to.
Returns:
TypeDescription
vbt.DataA vbt.Data object containing historical data for each symbol.

run_task

run_task(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
Run task. Use SlackMessenger by default. Specify a particular time that the job should be run at. The format must make sense given how often the job is repeating. More info could be found in schedule.
  • For daily jobs -> HH:MM:SS or HH:MM
  • For hourly jobs -> MM:SS or :MM
  • For minute jobs -> :SS
Parameters:
NameTypeDefaultDescription
templatestr--Template name.
loader_clsvbt.Data--Data loader.
loader_paramstp.Kwargs--Data loader params.
model_clstp.Any--Model class.
all_paramstp.Kwargs--Model params.
timeframepd.Timedelta1hTimeframe used in the template for loading data. Defaults to 1h.
offsetstrNoneOptional offset for hourly/multi-hourly jobs. If None, it defaults to :00. Defaults to None.
channelstrNoneMessenger channel to use. The default is C08KQFF50GH.
kwargstp.Kwargs--Additional key-word arguments.
Returns:
TypeDescription
schedule.SchedulerScheduler.

run_thread

run_thread(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
Run task. Use SlackMessenger by default. Specify a particular time that the job should be run at. The format must make sense given how often the job is repeating. More info could be found in schedule.
  • For daily jobs -> HH:MM:SS or HH:MM
  • For hourly jobs -> MM:SS or :MM
  • For minute jobs -> :SS
Parameters:
NameTypeDefaultDescription
templatestr--Template name.
loader_clsvbt.Data--Data loader.
loader_paramstp.Kwargs--Data loader params.
model_clstp.Any--Model class.
all_paramstp.Kwargs--Model params.
timeframepd.Timedelta1hTimeframe used in the template for loading data. Defaults to 1h.
offsetstrNoneOptional offset for hourly/multi-hourly jobs. If None, it defaults to :00. Defaults to None.
channelstrNoneMessenger channel to use. The default is C08KQFF50GH.
kwargstp.Kwargs--Additional key-word arguments.
Returns:
TypeDescription
schedule.SchedulerScheduler.

run_process

run_process(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
Run task. Use SlackMessenger by default. Specify a particular time that the job should be run at. The format must make sense given how often the job is repeating. More info could be found in schedule.
  • For daily jobs -> HH:MM:SS or HH:MM
  • For hourly jobs -> MM:SS or :MM
  • For minute jobs -> :SS
Parameters:
NameTypeDefaultDescription
templatestr--Template name.
loader_clsvbt.Data--Data loader.
loader_paramstp.Kwargs--Data loader params.
model_clstp.Any--Model class.
all_paramstp.Kwargs--Model params.
timeframepd.Timedelta1hTimeframe used in the template for loading data. Defaults to 1h.
offsetstrNoneOptional offset for hourly/multi-hourly jobs. If None, it defaults to :00. Defaults to None.
channelstrNoneMessenger channel to use. The default is C08KQFF50GH. kwargs Additional key-word arguments.
Returns:
TypeDescription
schedule.SchedulerScheduler.

Methods

execute

execute(
    self,
    *args,
    **kwargs,
)
Abstract method to Generate and post a scheduled report. This method should be implemented in subclasses to define the specific logic for generating and posting reports. Parameters:
NameTypeDefaultDescription
argstuple--Positional arguments for the execute method.
kwargstp.Kwargs--Keyword arguments for the execute method.

job

job(
    self,
)
Job to run the scheduler. This method initializes the logger, measures execution time, and calls the execute method to perform the scheduled task. It also logs the elapsed time and peak RAM usage after execution.