self.register_cron_callback#
- lumibot.strategies.strategy.Strategy.register_cron_callback(self, cron_schedule: str, callback_function: Callable) str
Register a callback function to be executed according to a cron schedule.
- Parameters:
cron_schedule (str) – A cron schedule string (e.g., “0 9 * * 1-5” for 9:00 AM Monday through Friday)
callback_function (callable) – The function to call on the schedule
- Returns:
The job ID that can be used to remove the job later
- Return type:
str
Example
>>> self.register_cron_callback("0 9 * * 1-5", self.morning_update)
Notes
This method does nothing in backtesting mode.