Skip to content

error limit: AttributeError: 'LimitOrderBook' object has no attribute 'current_lob' #65

@rumcode

Description

@rumcode

Hi,

First, Thanks in advance.

When I run the sample Extract Full LOB at 1-Minute Intervals from the webpage https://pypi.org/project/meatpy/ , I get the error: AttributeError: 'LimitOrderBook' object has no attribute 'current_lob'

The nasdaq itch file I'm using is 07302019.NASDAQ_ITCH50.gz

In more detail the error is
41 processor.process_message(message)

File ~\AppData\Roaming\Python\Python313\site-packages\meatpy\itch50\itch50_market_processor.py:169, in ITCH50MarketProcessor.process_message(self, message, new_snapshot)
165 else:
166 raise InvalidBuySellIndicatorError(
167 f"Wrong value for bsindicator: {message.bsindicator}"
168 )
--> 169 self.pre_lob_event(timestamp)
170 self.enter_quote(
171 timestamp=timestamp,
172 price=message.price,
(...)
175 order_type=order_type,
176 )
177 elif isinstance(message, OrderExecutedMessage):

File ~\AppData\Roaming\Python\Python313\site-packages\meatpy\market_processor.py:276, in MarketProcessor.pre_lob_event(self, timestamp, new_snapshot)
274 self.create_lob(timestamp)
275 elif new_snapshot is True:
--> 276 self.before_lob_update(timestamp)
277 if self.current_lob.timestamp == timestamp:
278 self.current_lob.timestamp_inc += 1

File ~\AppData\Roaming\Python\Python313\site-packages\meatpy\market_processor.py:87, in MarketProcessor.before_lob_update(self, new_timestamp)
81 """Notify handlers before a limit order book update.
82
83 Args:
84 new_timestamp: The new timestamp for the upcoming update
85 """
86 for x in self.handlers:
---> 87 x.before_lob_update(self.current_lob, new_timestamp)

File ~\AppData\Roaming\Python\Python313\site-packages\meatpy\event_handlers\lob_event_recorder.py:113, in LOBEventRecorder.before_lob_update(self, market_processor, new_timestamp)
104 def before_lob_update(
105 self, market_processor: MarketProcessor, new_timestamp: Timestamp
106 ):
107 """Trigger before a book update (next event timestamp passed).
108
109 Args:
110 market_processor: The market processor instance
111 new_timestamp: The new timestamp for the update
112 """
--> 113 lob = market_processor.current_lob
114 if lob is None:
115 return

AttributeError: 'LimitOrderBook' object has no attribute 'current_lob'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions