From 2f03250fe87a3c1733d03cdcc276e8b1d4a49913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Gr=C3=A9goire?= Date: Fri, 9 Jan 2026 08:52:07 -0500 Subject: [PATCH] Fix AttributeError in OrderExecutedPriceMessage: use execution_price instead of price The ITCH 5.0 OrderExecutedPriceMessage class uses `execution_price` as its attribute name, but the code was incorrectly referencing `message.price`. This fixes the AttributeError when processing OrderExecutedPriceMessage. Fixes #69 Co-Authored-By: Claude Opus 4.5 --- src/meatpy/itch50/itch50_exec_trade_recorder.py | 4 ++-- src/meatpy/itch50/itch50_market_processor.py | 2 +- src/meatpy/itch50/itch50_order_event_recorder.py | 2 +- src/meatpy/itch50/itch50_top_of_book_message_recorder.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meatpy/itch50/itch50_exec_trade_recorder.py b/src/meatpy/itch50/itch50_exec_trade_recorder.py index edd3679..1871874 100644 --- a/src/meatpy/itch50/itch50_exec_trade_recorder.py +++ b/src/meatpy/itch50/itch50_exec_trade_recorder.py @@ -97,7 +97,7 @@ def message_event( "Queue": "Ask", "Volume": message.shares, "OrderID": message.order_ref, - "Price": message.price, + "Price": message.execution_price, } (queue, i, j) = lob.find_order(message.order_ref) record["OrderTimestamp"] = queue[i].queue[j].timestamp @@ -110,7 +110,7 @@ def message_event( "Queue": "Bid", "Volume": message.shares, "OrderID": message.order_ref, - "Price": message.price, + "Price": message.execution_price, } (queue, i, j) = lob.find_order(message.order_ref) record["OrderTimestamp"] = queue[i].queue[j].timestamp diff --git a/src/meatpy/itch50/itch50_market_processor.py b/src/meatpy/itch50/itch50_market_processor.py index bcb135f..79f9de7 100644 --- a/src/meatpy/itch50/itch50_market_processor.py +++ b/src/meatpy/itch50/itch50_market_processor.py @@ -197,7 +197,7 @@ def process_message( volume=message.shares, order_id=message.order_ref, trade_ref=message.match, - price=message.price, + price=message.execution_price, ) elif isinstance(message, OrderCancelMessage): if message.order_ref not in self._order_refs: diff --git a/src/meatpy/itch50/itch50_order_event_recorder.py b/src/meatpy/itch50/itch50_order_event_recorder.py index 9ab05c8..18c7609 100644 --- a/src/meatpy/itch50/itch50_order_event_recorder.py +++ b/src/meatpy/itch50/itch50_order_event_recorder.py @@ -111,7 +111,7 @@ def message_event(self, market_processor, timestamp, message) -> None: "order_ref": message.order_ref, "bsindicator": "", "shares": message.shares, - "price": message.price, + "price": message.execution_price, "neworder_ref": "", "MessageType": "OrderExecutedPrice", } diff --git a/src/meatpy/itch50/itch50_top_of_book_message_recorder.py b/src/meatpy/itch50/itch50_top_of_book_message_recorder.py index 0c0a955..4d1e724 100644 --- a/src/meatpy/itch50/itch50_top_of_book_message_recorder.py +++ b/src/meatpy/itch50/itch50_top_of_book_message_recorder.py @@ -123,7 +123,7 @@ def message_event(self, market_processor, timestamp, message) -> None: "Queue": "Ask", "Volume": message.shares, "OrderID": message.order_ref, - "Price": message.price, + "Price": message.execution_price, } self.records.append((timestamp, record)) elif len(lob.bid_levels) > 0 and lob.bid_levels[0].order_on_book( @@ -134,7 +134,7 @@ def message_event(self, market_processor, timestamp, message) -> None: "Queue": "Bid", "Volume": message.shares, "OrderID": message.order_ref, - "Price": message.price, + "Price": message.execution_price, } self.records.append((timestamp, record)) elif isinstance(message, OrderCancelMessage):