From 50c5dc255ce2dc9359f51877f92ca1d95e535b65 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 1 Sep 2022 18:59:50 -0400 Subject: [PATCH] Update history view y-sticky with last clear price --- piker/ui/_display.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index c24d1d9c..e0b0711d 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -143,6 +143,7 @@ class DisplayState: # axis labels l1: L1Labels last_price_sticky: YAxisLabel + hist_last_price_sticky: YAxisLabel # misc state tracking vars: dict[str, Any] @@ -192,6 +193,11 @@ async def graphics_update_loop( *ohlcv.array[-1][['index', 'close']] ) + hist_last_price_sticky = hist_chart._ysticks[hist_chart.name] + hist_last_price_sticky.update_from_data( + *hist_ohlcv.array[-1][['index', 'close']] + ) + maxmin = partial( chart_maxmin, chart, @@ -241,6 +247,7 @@ async def graphics_update_loop( 'hist_ohlcv': hist_ohlcv, 'chart': chart, 'last_price_sticky': last_price_sticky, + 'hist_last_price_sticky': hist_last_price_sticky, 'l1': l1, 'vars': { @@ -549,6 +556,9 @@ def graphics_update_cycle( ds.last_price_sticky.update_from_data( *end[['index', 'close']] ) + ds.hist_last_price_sticky.update_from_data( + *end[['index', 'close']] + ) if wap_in_history: # update vwap overlay line @@ -868,7 +878,7 @@ async def display_symbol_data( _, _, ratio = feed.get_ds_info() break except IndexError: - await trio.sleep(0.001) + await trio.sleep(0.01) continue else: raise RuntimeError(