From 7b44f8947a94dbe4f7c23a43e6fbfe331f93d29b Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 19 八月 2024 16:58:55 +0800 Subject: [PATCH] 整体撤单比例不足加入提示原因 --- code_attribute/code_volumn_manager.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code_attribute/code_volumn_manager.py b/code_attribute/code_volumn_manager.py index 3c046c8..ed87496 100644 --- a/code_attribute/code_volumn_manager.py +++ b/code_attribute/code_volumn_manager.py @@ -91,8 +91,13 @@ def get_volume_rate(code, total_sell_volume=0, with_info=False): today = get_today_volumn(code) max60, yesterday = get_histry_volumn(code) - if today is None or max60 is None or yesterday is None: - raise Exception(f"鑾峰彇閲忓け璐�:{code}") + if today is None: + today = 0 + if max60 is None or yesterday is None: + max60 = [today, ''] + yesterday = today + if max60[0] < 1: + max60[0] = 1 rate = round((int(today) + total_sell_volume) / max(int(max60[0]), int(yesterday)), 2) if not with_info: return rate -- Gitblit v1.8.0