| | |
| | | return MARKET_TYPE_UNKNOWN |
| | | |
| | | |
| | | def is_stock(code): |
| | | """ |
| | | 是否是股票 |
| | | :param code: |
| | | :return: |
| | | """ |
| | | return code.find("00") == 0 or code.find("30") == 0 or code.find("60") == 0 or code.find("68") == 0 |
| | | |
| | | |
| | | def get_limit_up_rate(code): |
| | | # 获取涨停倍数 |
| | | if code.find("00") == 0 or code.find("60") == 0: |
| | |
| | | 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_) |