TOSQUASH: 84ad34f51
, lingering `float` casts..
parent
3ff0a86741
commit
36cc0cf750
|
@ -181,7 +181,6 @@ class OrderMode:
|
||||||
line.update_labels(order_info)
|
line.update_labels(order_info)
|
||||||
|
|
||||||
# update bound-in staged order
|
# update bound-in staged order
|
||||||
# order.price = level
|
|
||||||
mkt: MktPair = self.curr_mkt
|
mkt: MktPair = self.curr_mkt
|
||||||
order.price: Decimal = mkt.quantize(
|
order.price: Decimal = mkt.quantize(
|
||||||
size=level,
|
size=level,
|
||||||
|
@ -245,7 +244,6 @@ class OrderMode:
|
||||||
size=y,
|
size=y,
|
||||||
quantity_type='price',
|
quantity_type='price',
|
||||||
)
|
)
|
||||||
# order.price = y
|
|
||||||
|
|
||||||
line._on_level_change = update_order_price
|
line._on_level_change = update_order_price
|
||||||
|
|
||||||
|
@ -396,7 +394,7 @@ class OrderMode:
|
||||||
'oid': oid,
|
'oid': oid,
|
||||||
})
|
})
|
||||||
|
|
||||||
if order.price <= 0:
|
if float(order.price) <= 0:
|
||||||
log.error(
|
log.error(
|
||||||
'*!? Invalid `Order.price <= 0` ?!*\n'
|
'*!? Invalid `Order.price <= 0` ?!*\n'
|
||||||
# TODO: make this present multi-line in object form
|
# TODO: make this present multi-line in object form
|
||||||
|
@ -1194,7 +1192,7 @@ async def process_trade_msg(
|
||||||
tm = time.time()
|
tm = time.time()
|
||||||
mode.on_fill(
|
mode.on_fill(
|
||||||
oid,
|
oid,
|
||||||
price=req.price,
|
price=float(req.price),
|
||||||
time_s=tm,
|
time_s=tm,
|
||||||
)
|
)
|
||||||
mode.lines.remove_line(uuid=oid)
|
mode.lines.remove_line(uuid=oid)
|
||||||
|
@ -1249,7 +1247,7 @@ async def process_trade_msg(
|
||||||
tm = details['broker_time']
|
tm = details['broker_time']
|
||||||
mode.on_fill(
|
mode.on_fill(
|
||||||
oid,
|
oid,
|
||||||
price=details['price'],
|
price=float(details['price']),
|
||||||
time_s=tm,
|
time_s=tm,
|
||||||
pointing='up' if action == 'buy' else 'down',
|
pointing='up' if action == 'buy' else 'down',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue