From 72889b4d1f16f6314302f1d99fbdbbedcbae6859 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 4 Aug 2022 15:53:50 -0400 Subject: [PATCH] Fix reference error --- piker/clearing/_ems.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/clearing/_ems.py b/piker/clearing/_ems.py index 4b89205c..b9cb0aad 100644 --- a/piker/clearing/_ems.py +++ b/piker/clearing/_ems.py @@ -903,8 +903,8 @@ async def process_client_order_cmds( # TODO: eventually we should be receiving # this struct on the wire unpacked in a scoped protocol # setup with ``tractor``. - msg = Order(**cmd) - broker = msg.brokers[0] + req = Order(**cmd) + broker = req.brokers[0] # remove the broker part before creating a message # to send to the specific broker since they probably @@ -931,7 +931,7 @@ async def process_client_order_cmds( action=action, price=trigger_price, size=size, - account=msg.account, + account=req.account, ) # send request to backend @@ -959,6 +959,7 @@ async def process_client_order_cmds( 'size': size, 'exec_mode': exec_mode, 'action': action, + 'brokers': brokers, # list } if ( # "DARK" triggers # submit order to local EMS book and scan loop, @@ -983,6 +984,7 @@ async def process_client_order_cmds( pred = mk_check(trigger_price, last, action) spread_slap: float = 5 + sym = fqsn.replace(f'.{brokers[0]}', '') min_tick = feed.symbols[sym].tick_size if action == 'buy':