Administrator
2024-06-11 466cd5b36cd4a3bb46e8449f640c51d06b99a90d
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