From c57d4b2181be87b444c64fe45bfaf6586794999f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 20 Jun 2023 15:24:07 -0400 Subject: [PATCH] ib: map some tick types particulary "volumeRate" to avoid auto-range issue --- piker/brokers/ib/feed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/piker/brokers/ib/feed.py b/piker/brokers/ib/feed.py index 2ceb8acb..07e9b44f 100644 --- a/piker/brokers/ib/feed.py +++ b/piker/brokers/ib/feed.py @@ -73,6 +73,7 @@ from piker.accounting import ( from piker.data.validate import FeedInit +# XXX NOTE: See available types table docs: # https://interactivebrokers.github.io/tws-api/tick_types.html tick_types = { 77: 'trade', @@ -92,9 +93,9 @@ tick_types = { # ``ib_insync`` already packs these into # quotes under the following fields. - # 55: 'trades_per_min', # `'tradeRate'` - # 56: 'vlm_per_min', # `'volumeRate'` - # 89: 'shortable', # `'shortableShares'` + 55: 'trades_per_min', # `'tradeRate'` + 56: 'vlm_per_min', # `'volumeRate'` + 89: 'shortable_units', # `'shortableShares'` } @@ -1048,7 +1049,6 @@ async def stream_quotes( async for ticker in stream: quote = normalize(ticker) fqme = quote['fqme'] - # print(f'sending {fqme}:\n{quote}') await send_chan.send({fqme: quote}) # ugh, clear ticks since we've consumed them