Fix reference error

the_ems_flattening
Tyler Goodlet 2022-08-04 15:53:50 -04:00
parent ae001c3dd7
commit 72889b4d1f
1 changed files with 5 additions and 3 deletions

View File

@ -903,8 +903,8 @@ async def process_client_order_cmds(
# TODO: eventually we should be receiving # TODO: eventually we should be receiving
# this struct on the wire unpacked in a scoped protocol # this struct on the wire unpacked in a scoped protocol
# setup with ``tractor``. # setup with ``tractor``.
msg = Order(**cmd) req = Order(**cmd)
broker = msg.brokers[0] broker = req.brokers[0]
# remove the broker part before creating a message # remove the broker part before creating a message
# to send to the specific broker since they probably # to send to the specific broker since they probably
@ -931,7 +931,7 @@ async def process_client_order_cmds(
action=action, action=action,
price=trigger_price, price=trigger_price,
size=size, size=size,
account=msg.account, account=req.account,
) )
# send request to backend # send request to backend
@ -959,6 +959,7 @@ async def process_client_order_cmds(
'size': size, 'size': size,
'exec_mode': exec_mode, 'exec_mode': exec_mode,
'action': action, 'action': action,
'brokers': brokers, # list
} if ( } if (
# "DARK" triggers # "DARK" triggers
# submit order to local EMS book and scan loop, # 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) pred = mk_check(trigger_price, last, action)
spread_slap: float = 5 spread_slap: float = 5
sym = fqsn.replace(f'.{brokers[0]}', '')
min_tick = feed.symbols[sym].tick_size min_tick = feed.symbols[sym].tick_size
if action == 'buy': if action == 'buy':