diff --git a/piker/fsp/_momo.py b/piker/fsp/_momo.py index 01e41c04..488ae22c 100644 --- a/piker/fsp/_momo.py +++ b/piker/fsp/_momo.py @@ -167,6 +167,7 @@ def _wma( assert length == len(weights) + # lol, for long sequences this is nutso slow and expensive.. return np.convolve(signal, weights, 'valid') diff --git a/piker/fsp/_volume.py b/piker/fsp/_volume.py index 47211234..b5456fac 100644 --- a/piker/fsp/_volume.py +++ b/piker/fsp/_volume.py @@ -309,7 +309,7 @@ async def flow_rates( if period > 1: trade_rate_wma = _wma( - dvlm_shm.array['trade_count'], + dvlm_shm.array['trade_count'][-period:], period, weights=weights, ) @@ -332,7 +332,7 @@ async def flow_rates( if period > 1: dark_trade_rate_wma = _wma( - dvlm_shm.array['dark_trade_count'], + dvlm_shm.array['dark_trade_count'][-period:], period, weights=weights, )