April 2019
Intermediate to advanced
426 pages
11h 13m
English
Inside the Broker class, add the following two methods as the getter and setter for the price event handler, respectively:
@property
def on_price_event(self):
"""
Listeners will receive: symbol, bid, ask
"""
return self.__price_event_handler
@on_price_event.setter
def on_price_event(self, event_handler):
self.__price_event_handler = event_handler
The inheriting child classes will notify the listeners through the on_price_event method invocation of the symbol, the bid price, and the ask price. Later on, we will use these pieces of basic information for our trading decisions.
Read now
Unlock full access