Pass in fqsn from chart UI components

marketstore_backup
Tyler Goodlet 2022-03-18 15:07:48 -04:00
parent 3f060ac53a
commit 3187413b77
1 changed files with 11 additions and 14 deletions

View File

@ -30,7 +30,7 @@ import numpy as np
import tractor import tractor
import trio import trio
import pyqtgraph as pg import pyqtgraph as pg
from PyQt5.QtCore import QLineF, QPointF from PyQt5.QtCore import QLineF
from .. import brokers from .. import brokers
from ..data.feed import open_feed from ..data.feed import open_feed
@ -263,9 +263,7 @@ async def graphics_update_loop(
# main loop # main loop
async for quotes in stream: async for quotes in stream:
ds.quotes = quotes ds.quotes = quotes
quote_period = time.time() - last_quote quote_period = time.time() - last_quote
quote_rate = round( quote_rate = round(
1/quote_period, 1) if quote_period > 0 else float('inf') 1/quote_period, 1) if quote_period > 0 else float('inf')
@ -300,7 +298,7 @@ def graphics_update_cycle(
# hopefully XD # hopefully XD
profiler = pg.debug.Profiler( profiler = pg.debug.Profiler(
disabled=False, # not pg_profile_enabled(), disabled=True, # not pg_profile_enabled(),
delayed=False, delayed=False,
) )
# unpack multi-referenced components # unpack multi-referenced components
@ -372,7 +370,6 @@ def graphics_update_cycle(
# f' x: {x}\n' # f' x: {x}\n'
# f' y: {y}\n' # f' y: {y}\n'
# ) # )
# breakpoint()
# assert y.size == mxmn.size # assert y.size == mxmn.size
@ -632,10 +629,10 @@ async def display_symbol_data(
# clear_on_next=True, # clear_on_next=True,
# group_key=loading_sym_key, # group_key=loading_sym_key,
# ) # )
fqsn = '.'.join((sym, provider))
async with open_feed( async with open_feed(
provider, [fqsn],
[sym],
loglevel=loglevel, loglevel=loglevel,
# limit to at least display's FPS # limit to at least display's FPS
@ -646,10 +643,11 @@ async def display_symbol_data(
ohlcv: ShmArray = feed.shm ohlcv: ShmArray = feed.shm
bars = ohlcv.array bars = ohlcv.array
symbol = feed.symbols[sym] symbol = feed.symbols[sym]
fqsn = symbol.front_fqsn()
# load in symbol's ohlc data # load in symbol's ohlc data
godwidget.window.setWindowTitle( godwidget.window.setWindowTitle(
f'{symbol.key}@{symbol.brokers} ' f'{fqsn} '
f'tick:{symbol.tick_size} ' f'tick:{symbol.tick_size} '
f'step:1s ' f'step:1s '
) )
@ -734,8 +732,7 @@ async def display_symbol_data(
open_order_mode( open_order_mode(
feed, feed,
chart, chart,
symbol, fqsn,
provider,
order_mode_started order_mode_started
) )
): ):