Compare commits

..

No commits in common. "a8598b17fbbc9a94ee44dd58465129dde3517841" and "44c339779f6573d8e1144fd563939ee4bad274c8" have entirely different histories.

5 changed files with 13 additions and 30 deletions

View File

@ -948,7 +948,6 @@ class Client:
) )
if tkr: if tkr:
break break
except TimeoutError as err: except TimeoutError as err:
timeouterr = err timeouterr = err
await asyncio.sleep(0.01) await asyncio.sleep(0.01)
@ -957,9 +956,7 @@ class Client:
else: else:
if not warnset: if not warnset:
log.warning( log.warning(
f'Quote req timed out..\n' f'Quote req timed out..maybe venue is closed?\n'
f'Maybe the venue is closed?\n'
f'\n'
f'{asdict(contract)}' f'{asdict(contract)}'
) )
warnset = True warnset = True
@ -971,11 +968,9 @@ class Client:
) )
break break
else: else:
if ( if timeouterr and raise_on_timeout:
timeouterr import pdbp
and pdbp.set_trace()
raise_on_timeout
):
raise timeouterr raise timeouterr
if not warnset: if not warnset:

View File

@ -117,11 +117,7 @@ def pack_position(
symbol=fqme, symbol=fqme,
currency=con.currency, currency=con.currency,
size=float(pos.position), size=float(pos.position),
avg_price=( avg_price=float(pos.avgCost) / float(con.multiplier or 1.0),
float(pos.avgCost)
/
float(con.multiplier or 1.0)
),
), ),
) )
@ -567,7 +563,7 @@ async def open_trade_dialog(
ledgers: dict[str, TransactionLedger] = {} ledgers: dict[str, TransactionLedger] = {}
tables: dict[str, Account] = {} tables: dict[str, Account] = {}
order_msgs: list[Status] = [] order_msgs: list[Status] = []
conf: dict = get_config() conf = get_config()
accounts_def_inv: bidict[str, str] = bidict( accounts_def_inv: bidict[str, str] = bidict(
conf['accounts'] conf['accounts']
).inverse ).inverse

View File

@ -1079,8 +1079,7 @@ async def stream_quotes(
con: Contract = details.contract con: Contract = details.contract
first_ticker: Ticker|None = None first_ticker: Ticker|None = None
timeout: float = 1.6 with trio.move_on_after(1.6) as quote_cs:
with trio.move_on_after(timeout) as quote_cs:
first_ticker: Ticker = await proxy.get_quote( first_ticker: Ticker = await proxy.get_quote(
contract=con, contract=con,
raise_on_timeout=False, raise_on_timeout=False,
@ -1089,9 +1088,7 @@ async def stream_quotes(
# XXX should never happen with this ep right? # XXX should never happen with this ep right?
# but if so then, more then likely mkt is closed? # but if so then, more then likely mkt is closed?
if quote_cs.cancelled_caught: if quote_cs.cancelled_caught:
log.warning( await tractor.pause()
f'First quote req timed out after {timeout!r}s'
)
if first_ticker: if first_ticker:
first_quote: dict = normalize(first_ticker) first_quote: dict = normalize(first_ticker)

View File

@ -41,13 +41,10 @@ from .log import get_logger
log = get_logger('broker-config') log = get_logger('broker-config')
# XXX NOTE: taken from `click` # XXX NOTE: taken from ``click`` since apparently they have some
# |_https://github.com/pallets/click/blob/main/src/click/utils.py#L449 # super weirdness with sigint and sudo..no clue
# # we're probably going to slowly just modify it to our own version over
# (since apparently they have some super weirdness with SIGINT and # time..
# sudo.. no clue we're probably going to slowly just modify it to our
# own version over time..)
#
def get_app_dir( def get_app_dir(
app_name: str, app_name: str,
roaming: bool = True, roaming: bool = True,

View File

@ -357,9 +357,7 @@ async def allocate_persistent_feed(
# yield back control to starting nursery once we receive either # yield back control to starting nursery once we receive either
# some history or a real-time quote. # some history or a real-time quote.
log.info( log.info(f'loading OHLCV history: {fqme}')
f'loading OHLCV history: {fqme!r}\n'
)
await some_data_ready.wait() await some_data_ready.wait()
flume = Flume( flume = Flume(