From 4e5df973a9a9cc0c5eb48ef418e76353b88c4113 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 12 Jul 2022 16:55:15 -0400 Subject: [PATCH] Support `Forex` tracts in `normalize()` --- piker/brokers/ib/feed.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/piker/brokers/ib/feed.py b/piker/brokers/ib/feed.py index b22ddc1b..92538965 100644 --- a/piker/brokers/ib/feed.py +++ b/piker/brokers/ib/feed.py @@ -573,7 +573,6 @@ def normalize( con = ticker.contract if type(con) in ( ibis.Commodity, - ibis.Forex, ): # commodities and forex don't have an exchange name and # no real volume so we have to calculate the price @@ -581,6 +580,14 @@ def normalize( # no real volume on this tract calc_price = True + elif type(con) in ( + ibis.Forex, + ): + suffix = 'forex' + con.symbol = con.pair() + # no real volume on forex feeds.. + calc_price = True + else: suffix = con.primaryExchange if not suffix: @@ -812,6 +819,9 @@ async def data_reset_hack( successful. - other OS support? - integration with ``ib-gw`` run in docker + Xorg? + - is it possible to offer a local server that can be accessed by + a client? Would be sure be handy for running native java blobs + that need to be wrangle. '''