Administrator
2024-06-13 ddd49deef7ac6daff95086f112a0061a641c4fe3
l2/l2_data_manager.py
@@ -16,10 +16,11 @@
class OrderBeginPosInfo(object):
    MODE_NORMAL = 0
    MODE_FAST = 1
    MODE_ACTIVE = 2
    # mode: 0-普通交易  1-快速交易
    def __init__(self, buy_single_index=None, buy_exec_index=-1, buy_compute_index=None, num=0, count=0,
                 max_num_set=None, buy_volume_rate=None, sell_info=None, threshold_money=None, mode=0,
                 max_num_set=None, buy_volume_rate=None, sell_info=None, threshold_money=None, mode=0, mode_desc=None,
                 at_limit_up=False):
        self.buy_single_index = buy_single_index
        self.buy_exec_index = buy_exec_index
@@ -34,6 +35,7 @@
        self.buy_volume_rate = buy_volume_rate
        self.sell_info = sell_info
        self.mode = mode
        self.mode_desc = mode_desc
        # 是否是板上买
        self.at_limit_up = at_limit_up
@@ -149,6 +151,11 @@
        CodeDataCacheUtil.set_cache(self.__buy_compute_index_info_cache, code, data_)
        RedisUtils.setex_async(self.__db, _key, expire, data_.to_json_str())
    # 是否已经下单
    @classmethod
    def is_placed_order(cls, order_begin_pos: OrderBeginPosInfo):
        return order_begin_pos and order_begin_pos.buy_exec_index is not None and order_begin_pos.buy_exec_index > -1
# 清除l2数据
def clear_l2_data(code):