MCPcopy Create free account
hub / github.com/quantopian/zipline / add_event

Method add_event

zipline/algorithm.py:878–890  ·  view source on GitHub ↗

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.

(self, rule, callback)

Source from the content-addressed store, hash-verified

876 return csv_data_source
877
878 def add_event(self, rule, callback):
879 """Adds an event to the algorithm's EventManager.
880
881 Parameters
882 ----------
883 rule : EventRule
884 The rule for when the callback should be triggered.
885 callback : callable[(context, data) -> None]
886 The function to execute when the rule is triggered.
887 """
888 self.event_manager.add_event(
889 zipline.utils.events.Event(rule, callback),
890 )
891
892 @api_method
893 def schedule_function(self,

Callers 2

schedule_functionMethod · 0.95
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected