Delegate graphics cycle max/min to chart/flows

incr_update_backup
Tyler Goodlet 2022-04-21 15:15:00 -04:00
parent 6f5bb9cbe0
commit fae249dd2f
1 changed files with 4 additions and 15 deletions

View File

@ -94,28 +94,17 @@ def chart_maxmin(
Compute max and min datums "in view" for range limits. Compute max and min datums "in view" for range limits.
''' '''
array = ohlcv_shm.array
ifirst = array[0]['index']
last_bars_range = chart.bars_range() last_bars_range = chart.bars_range()
l, lbar, rbar, r = last_bars_range out = chart.maxmin()
in_view = array[lbar - ifirst:rbar - ifirst + 1]
if not in_view.size: if out is None:
log.warning('Resetting chart to data')
chart.default_view()
return (last_bars_range, 0, 0, 0) return (last_bars_range, 0, 0, 0)
mx, mn = ( mn, mx = out
np.nanmax(in_view['high']),
np.nanmin(in_view['low'],)
)
mx_vlm_in_view = 0 mx_vlm_in_view = 0
if vlm_chart: if vlm_chart:
mx_vlm_in_view = np.max( _, mx_vlm_in_view = vlm_chart.maxmin()
in_view['volume']
)
return ( return (
last_bars_range, last_bars_range,