From 061204832c6eb71d5583fa8ebdd41479100b6b54 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 17 十一月 2023 19:03:41 +0800 Subject: [PATCH] L撤修改/已成交统计修改 --- l2/transaction_progress.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/l2/transaction_progress.py b/l2/transaction_progress.py index b507231..37a1f1d 100644 --- a/l2/transaction_progress.py +++ b/l2/transaction_progress.py @@ -191,9 +191,10 @@ if not last_info or last_info[0] != index: if last_info and total_datas: val = total_datas[last_info[0]]['val'] - rate = round(val["num"] * float(val["price"]) * 100 / (time.time() - last_info[1])) - # 鎴愪氦閫熺巼 - self.trade_speed_cache[code] = rate + if time.time() - last_info[1] > 0: + rate = round(val["num"] * float(val["price"]) * 100 / (time.time() - last_info[1])) + # 鎴愪氦閫熺巼 + self.trade_speed_cache[code] = rate self.latest_buy_progress_index_cache[code] = (index, time.time()) self.__save_buy_progress_index(code, index, False) -- Gitblit v1.8.0