Raw-dog-pop cancelled paper entries; old price dun matter
parent
430d065da6
commit
9200e8da57
|
@ -106,7 +106,6 @@ class PaperBoi(Struct):
|
||||||
if entry:
|
if entry:
|
||||||
# order is already existing, this is a modify
|
# order is already existing, this is a modify
|
||||||
(oid, symbol, action, old_price) = entry
|
(oid, symbol, action, old_price) = entry
|
||||||
assert old_price != price
|
|
||||||
is_modify = True
|
is_modify = True
|
||||||
else:
|
else:
|
||||||
# register order internally
|
# register order internally
|
||||||
|
@ -183,9 +182,9 @@ class PaperBoi(Struct):
|
||||||
oid, symbol, action, price = self._reqids[reqid]
|
oid, symbol, action, price = self._reqids[reqid]
|
||||||
|
|
||||||
if action == 'buy':
|
if action == 'buy':
|
||||||
self._buys[symbol].pop((oid, price))
|
self._buys[symbol].pop(oid, None)
|
||||||
elif action == 'sell':
|
elif action == 'sell':
|
||||||
self._sells[symbol].pop((oid, price))
|
self._sells[symbol].pop(oid, None)
|
||||||
|
|
||||||
# TODO: net latency model
|
# TODO: net latency model
|
||||||
await trio.sleep(0.05)
|
await trio.sleep(0.05)
|
||||||
|
|
Loading…
Reference in New Issue