ib: warn about mkt precision cuckups that `Contract`s clearly deliver wrong..
parent
3531c2edc1
commit
f12c452d96
|
@ -294,7 +294,7 @@ async def open_symbol_search(ctx: tractor.Context) -> None:
|
||||||
elif stock_results:
|
elif stock_results:
|
||||||
break
|
break
|
||||||
# else:
|
# else:
|
||||||
await tractor.pause()
|
# await tractor.pause()
|
||||||
|
|
||||||
# # match against our ad-hoc set immediately
|
# # match against our ad-hoc set immediately
|
||||||
# adhoc_matches = fuzzy.extract(
|
# adhoc_matches = fuzzy.extract(
|
||||||
|
@ -522,7 +522,21 @@ async def get_mkt_info(
|
||||||
venue = con.primaryExchange or con.exchange
|
venue = con.primaryExchange or con.exchange
|
||||||
|
|
||||||
price_tick: Decimal = Decimal(str(details.minTick))
|
price_tick: Decimal = Decimal(str(details.minTick))
|
||||||
# price_tick: Decimal = Decimal('0.01')
|
ib_min_tick_gt_2: Decimal = Decimal('0.01')
|
||||||
|
if (
|
||||||
|
price_tick < ib_min_tick_gt_2
|
||||||
|
):
|
||||||
|
# TODO: we need to add some kinda dynamic rounding sys
|
||||||
|
# to our MktPair i guess?
|
||||||
|
# not sure where the logic should sit, but likely inside
|
||||||
|
# the `.clearing._ems` i suppose...
|
||||||
|
log.warning(
|
||||||
|
'IB seems to disallow a min price tick < 0.01 '
|
||||||
|
'when the price is > 2.0..?\n'
|
||||||
|
f'Decreasing min tick precision for {fqme} to 0.01'
|
||||||
|
)
|
||||||
|
# price_tick = ib_min_tick
|
||||||
|
# await tractor.pause()
|
||||||
|
|
||||||
if atype == 'stock':
|
if atype == 'stock':
|
||||||
# XXX: GRRRR they don't support fractional share sizes for
|
# XXX: GRRRR they don't support fractional share sizes for
|
||||||
|
|
Loading…
Reference in New Issue