code: def add_event(self, rule, callback):
          
          self.event_manager.add_event(
              zipline.utils.events.Event(rule, callback),
          )
docs: Adds an event to the algorithm's EventManager.
  
          Parameters
          ----------
          rule : EventRule
              The rule for when the callback should be triggered.
          callback : callable[(context, data) -> None]
              The function to execute when the rule is triggered.