From 8c7f84cbd0afde7600b0c67a8032fa19c57d8c41 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 05 二月 2024 11:18:33 +0800 Subject: [PATCH] L撤快速成交触发撤单修改 --- code_attribute/code_volumn_manager.py | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/code_attribute/code_volumn_manager.py b/code_attribute/code_volumn_manager.py index 3f578b1..45d9510 100644 --- a/code_attribute/code_volumn_manager.py +++ b/code_attribute/code_volumn_manager.py @@ -18,12 +18,13 @@ # 璁剧疆鍘嗗彶閲� -def set_histry_volumn(code, max60, yesterday, max60_day=''): +def set_histry_volumn(code, max60, yesterday, max60_day, max60_day_count): redis = __redis_manager.getRedis() - global_util.max60_volumn[code] = (max60, max60_day) + global_util.max60_volumn[code] = (max60, max60_day,max60_day_count) global_util.yesterday_volumn[code] = yesterday try: - RedisUtils.setex_async(0, "volumn_max60-{}".format(code), tool.get_expire(), json.dumps((max60, max60_day)), + RedisUtils.setex_async(0, "volumn_max60-{}".format(code), tool.get_expire(), + json.dumps((max60, max60_day, max60_day_count)), auto_free=False) RedisUtils.setex_async(0, "volumn_yes-{}".format(code), tool.get_expire(), yesterday, auto_free=False) finally: @@ -97,6 +98,18 @@ return rate, (today, max(int(max60[0]), int(yesterday))) +# 鑾峰彇閲忓弬鑰冩棩鏈� +# 杩斿洖(鍙傝�冮噺鏃ユ湡,璺濅粖鐨勪氦鏄撴棩涓暟) +def get_volume_refer_date(code): + max60, yesterday = get_histry_volumn(code) + if max60 is None or yesterday is None: + raise Exception("鑾峰彇澶辫触") + if int(max60[0]) >= int(yesterday): + return max60[1], max60[2] + else: + return "涓婁釜浜ゆ槗鏃�", 0 + + # 鑾峰彇閲忔瘮绱㈠紩 def get_volume_rate_index(volume_rate): rates = [0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6] -- Gitblit v1.8.0