Administrator
2023-09-13 8ea6200de76e128b54ad51e75014b5fc051b55ca
utils/huaxin_util.py
@@ -1,4 +1,8 @@
# 报单状态
import threading
from utils import tool
TORA_TSTP_OST_Cached = '0'  # 预埋
TORA_TSTP_OST_Unknown = '1'  # 未知
TORA_TSTP_OST_Accepted = '2'  # 交易所已接收
@@ -48,3 +52,18 @@
    if state == TORA_TSTP_OST_PartTraded or state == TORA_TSTP_OST_AllTraded or state == TORA_TSTP_OST_PartTradeCanceled:
        return True
    return False
__order_ref_lock = threading.RLock()
__public_order_ref = int(tool.get_now_time_str().replace(":", ""))
# 创建订单引用
def create_order_ref():
    __order_ref_lock.acquire()
    try:
        global __public_order_ref
        __public_order_ref += 1
        return __public_order_ref
    finally:
        __order_ref_lock.release()