Set ack time on pydantic model

ems_to_bidir_streaming
Tyler Goodlet 2021-06-04 12:53:48 -04:00
parent f9238f3a8a
commit 0bcad35c70
1 changed files with 7 additions and 10 deletions

View File

@ -129,7 +129,7 @@ class OrderMode:
line = self.lines.commit_line(uuid)
req_msg = self.book._sent_orders.get(uuid)
if req_msg:
req_msg['ack_time_ns'] = time.time_ns()
req_msg.ack_time_ns = time.time_ns()
return line
@ -196,8 +196,10 @@ class OrderMode:
def submit_exec(
self,
size: Optional[float] = None,
) -> LevelLine:
"""Send execution order to EMS.
"""Send execution order to EMS return a level line to
represent the order on a chart.
"""
# register the "staged" line under the cursor
@ -226,6 +228,9 @@ class OrderMode:
exec_mode=self._exec_mode,
)
# TODO: update the line once an ack event comes back
# from the EMS!
# make line graphic if order push was
# sucessful
line = self.lines.create_order_line(
@ -266,14 +271,6 @@ class OrderMode:
price=line.value(),
)
# def on_key_press(
# self,
# key:
# mods:
# text: str,
# ) -> None:
# pass
@asynccontextmanager
async def open_order_mode(