admin
2025-02-21 7cf25ef1d66634b2515f58fba601fefc14af547e
bug修改
2个文件已修改
15 ■■■■■ 已修改文件
strategy/buying_strategy.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/huaxin_util.py 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py
@@ -18,7 +18,7 @@
from strategy import order_methods
from strategy.logging_config import get_logger
from utils import tool
from utils import tool, huaxin_util
# 获取logger实例
logger = get_logger()
@@ -119,6 +119,8 @@
    # current_quotes_buy == [[23.25, 800], [23.24, 1100], [23.23, 1100], [23.22, 2200], [23.21, 2300]]
    # current_quotes_sell == [[23.27, 500], [23.29, 200], [23.3, 6900], [23.31, 500], [23.32, 200]]
    current_created_at = current_info[7]  # 当前信息创建时间
    if type(current_created_at) == int:
        current_created_at = huaxin_util.convert_time(current_created_at)
    # print(f"current_created_at====={current_created_at}")
    # print(f"current_created_at  type====={type(current_created_at)}")
utils/huaxin_util.py
@@ -68,3 +68,14 @@
        return __public_order_ref
    finally:
        __order_ref_lock.release()
def convert_time(time_str, with_ms=False):
    time_str = str(time_str)
    if time_str.startswith("9"):
        time_str = f"0{time_str}"
    ms = "{:0<3}".format(time_str[6:])
    time_ = f"{time_str[0:2]}:{time_str[2:4]}:{time_str[4:6]}"
    if with_ms:
        return f"{time_}.{ms}"
    return time_