April 2019
Intermediate to advanced
426 pages
11h 13m
English
Write a class named TickData that represents a single unit of data received from a market data source with the following Python code:
class TickData(object): """ Stores a single unit of data """ def __init__(self, timestamp='', symbol='', open_price=0, close_price=0, total_volume=0): self.symbol = symbol self.timestamp = timestamp self.open_price = open_price self.close_price = close_price self.total_volume = total_volume
In this example, we are interested in storing the timestamp, symbol of the instrument, the opening and closing price, as well as the total volume traded. Detailed descriptions of a single unit of tick data, such as the highest price reached or last-traded volume, can be added as our system ...