I'm trying to use schedule_function()
to trigger a function that handles rolling futures contracts in the portfolio. I've specified the following in initialize()
with custom hours
and minutes
to confirm it's executing at the correct time:
zl.schedule_function(
roll,
zl.date_rules.every_day(),
zl.time_rules.market_open(hours=2, minutes=22),
)
However, when I log get_datetime()
from roll
, it's executing every day at either 21:00 or 22:00 UTC (due to DST).
Is scheduling daily functions incompatible with daily algos? My assumption is for a daily algo, Zipline optimizes the event loop to only run once per day even if there are functions scheduled for different times.
Thanks