From 1a0be577a89727ef6b80245b6b53c8ddf43ca7d9 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 07 六月 2024 00:37:26 +0800 Subject: [PATCH] 可购买创业板 --- code_attribute/gpcode_manager.py | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code_attribute/gpcode_manager.py b/code_attribute/gpcode_manager.py index 465959a..87864f1 100644 --- a/code_attribute/gpcode_manager.py +++ b/code_attribute/gpcode_manager.py @@ -696,9 +696,9 @@ data = get_gp_list() list = [] for d in data: - if d[0:2] == '00': + if tool.is_sz_code(d): list.append("SZSE.{}".format(d)) - elif d[0:2] == '60': + elif tool.is_sh_code(d): list.append("SHSE.{}".format(d)) return list @@ -746,7 +746,7 @@ price = CodePrePriceManager.get_price_pre_cache(code) if price is None: return None - limit_up_price = tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal("1.1")) + limit_up_price = tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal(tool.get_limit_up_rate(code))) __limit_up_price_dict[code] = limit_up_price return limit_up_price @@ -757,16 +757,16 @@ return None -def get_limit_up_price_by_preprice(price): +def get_limit_up_price_by_preprice(code, price): if price is None: return None - return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal("1.1")) + return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal(f"{tool.get_limit_up_rate(code)}")) -def get_limit_down_price_by_preprice(price): +def get_limit_down_price_by_preprice(code, price): if price is None: return None - return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal("0.9")) + return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal(f"{tool.get_limit_down_rate(code)}")) # 鑾峰彇璺屽仠浠� @@ -774,7 +774,7 @@ price = CodePrePriceManager.get_price_pre_cache(code) if price is None: return None - return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal("0.9")) + return tool.to_price(decimal.Decimal(str(price)) * decimal.Decimal(f"{tool.get_limit_down_rate(code)}")) # 鑾峰彇鐜颁环 -- Gitblit v1.8.0