From b9d5b904f448861eff0db94d28e69faa10c6bf7c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 12 Sep 2022 15:42:27 -0400 Subject: [PATCH] Drop order entry removals on modify --- piker/clearing/_paper_engine.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/piker/clearing/_paper_engine.py b/piker/clearing/_paper_engine.py index dadbbdfd..772defa8 100644 --- a/piker/clearing/_paper_engine.py +++ b/piker/clearing/_paper_engine.py @@ -98,8 +98,6 @@ class PaperBoi(Struct): Place an order and return integer request id provided by client. ''' - is_modify: bool = False - if action == 'alert': # bypass all fill simulation return reqid @@ -108,7 +106,6 @@ class PaperBoi(Struct): if entry: # order is already existing, this is a modify (oid, symbol, action, old_price) = entry - is_modify = True else: # register order internally self._reqids[reqid] = (oid, symbol, action, price) @@ -152,25 +149,18 @@ class PaperBoi(Struct): oid, ) + # register this submissions as a paper live order else: - # register this submissions as a paper live order - - # submit order to book simulation fill loop + # set the simulated order in the respective table for lookup + # and trigger by the simulated clearing task normally + # running ``simulate_fills()``. if action == 'buy': orders = self._buys elif action == 'sell': orders = self._sells - # set the simulated order in the respective table for lookup - # and trigger by the simulated clearing task normally - # running ``simulate_fills()``. - - if is_modify: - # remove any existing order for the old price - orders[symbol].pop(oid) - - # buys/sells: {symbol -> bidict[oid, ()]} + # {symbol -> bidict[oid, ()]} orders[symbol][oid] = (price, size, reqid, action) return reqid