Update history view y-sticky with last clear price
parent
31735f26d3
commit
50c5dc255c
|
@ -143,6 +143,7 @@ class DisplayState:
|
||||||
# axis labels
|
# axis labels
|
||||||
l1: L1Labels
|
l1: L1Labels
|
||||||
last_price_sticky: YAxisLabel
|
last_price_sticky: YAxisLabel
|
||||||
|
hist_last_price_sticky: YAxisLabel
|
||||||
|
|
||||||
# misc state tracking
|
# misc state tracking
|
||||||
vars: dict[str, Any]
|
vars: dict[str, Any]
|
||||||
|
@ -192,6 +193,11 @@ async def graphics_update_loop(
|
||||||
*ohlcv.array[-1][['index', 'close']]
|
*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(
|
maxmin = partial(
|
||||||
chart_maxmin,
|
chart_maxmin,
|
||||||
chart,
|
chart,
|
||||||
|
@ -241,6 +247,7 @@ async def graphics_update_loop(
|
||||||
'hist_ohlcv': hist_ohlcv,
|
'hist_ohlcv': hist_ohlcv,
|
||||||
'chart': chart,
|
'chart': chart,
|
||||||
'last_price_sticky': last_price_sticky,
|
'last_price_sticky': last_price_sticky,
|
||||||
|
'hist_last_price_sticky': hist_last_price_sticky,
|
||||||
'l1': l1,
|
'l1': l1,
|
||||||
|
|
||||||
'vars': {
|
'vars': {
|
||||||
|
@ -549,6 +556,9 @@ def graphics_update_cycle(
|
||||||
ds.last_price_sticky.update_from_data(
|
ds.last_price_sticky.update_from_data(
|
||||||
*end[['index', 'close']]
|
*end[['index', 'close']]
|
||||||
)
|
)
|
||||||
|
ds.hist_last_price_sticky.update_from_data(
|
||||||
|
*end[['index', 'close']]
|
||||||
|
)
|
||||||
|
|
||||||
if wap_in_history:
|
if wap_in_history:
|
||||||
# update vwap overlay line
|
# update vwap overlay line
|
||||||
|
@ -868,7 +878,7 @@ async def display_symbol_data(
|
||||||
_, _, ratio = feed.get_ds_info()
|
_, _, ratio = feed.get_ds_info()
|
||||||
break
|
break
|
||||||
except IndexError:
|
except IndexError:
|
||||||
await trio.sleep(0.001)
|
await trio.sleep(0.01)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
|
Loading…
Reference in New Issue