From 466cd5b36cd4a3bb46e8449f640c51d06b99a90d Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 11 六月 2024 17:25:04 +0800 Subject: [PATCH] API输出正股详细的信息 --- utils/tool.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index 0fe052d..65780fb 100644 --- a/utils/tool.py +++ b/utils/tool.py @@ -360,5 +360,18 @@ return 0.8 +def is_can_buy_code(code): + return code.find("00") == 0 or code.find("60") == 0 or code.find("30") == 0 + + +def get_limit_up_price(code, pre_close_price): + limit_up_price = to_price(decimal.Decimal(str(pre_close_price)) * decimal.Decimal(f"{get_limit_up_rate(code)}")) + return limit_up_price + +# 灏嗘椂闂存埑s鏍煎紡鍖� +def to_time_str(timestamp_second, format_="%H:%M:%S"): + return datetime.datetime.fromtimestamp(timestamp_second).strftime(format_) + + if __name__ == "__main__": pass -- Gitblit v1.8.0