ib: map some tick types particulary "volumeRate" to avoid auto-range issue

basic_buy_bot
Tyler Goodlet 2023-06-20 15:24:07 -04:00
parent 6c10c2f623
commit c57d4b2181
1 changed files with 4 additions and 4 deletions

View File

@ -73,6 +73,7 @@ from piker.accounting import (
from piker.data.validate import FeedInit from piker.data.validate import FeedInit
# XXX NOTE: See available types table docs:
# https://interactivebrokers.github.io/tws-api/tick_types.html # https://interactivebrokers.github.io/tws-api/tick_types.html
tick_types = { tick_types = {
77: 'trade', 77: 'trade',
@ -92,9 +93,9 @@ tick_types = {
# ``ib_insync`` already packs these into # ``ib_insync`` already packs these into
# quotes under the following fields. # quotes under the following fields.
# 55: 'trades_per_min', # `'tradeRate'` 55: 'trades_per_min', # `'tradeRate'`
# 56: 'vlm_per_min', # `'volumeRate'` 56: 'vlm_per_min', # `'volumeRate'`
# 89: 'shortable', # `'shortableShares'` 89: 'shortable_units', # `'shortableShares'`
} }
@ -1048,7 +1049,6 @@ async def stream_quotes(
async for ticker in stream: async for ticker in stream:
quote = normalize(ticker) quote = normalize(ticker)
fqme = quote['fqme'] fqme = quote['fqme']
# print(f'sending {fqme}:\n{quote}')
await send_chan.send({fqme: quote}) await send_chan.send({fqme: quote})
# ugh, clear ticks since we've consumed them # ugh, clear ticks since we've consumed them