Administrator
2023-01-13 48dcb788e821d40be37fa05c9789b751a6e2a69b
l2_data_manager.py
@@ -78,9 +78,9 @@
        _key = "buy_compute_index_info-{}".format(code)
        _data_json = redis.get(_key)
        if _data_json is None:
            return None, None, None, 0, 0
            return None, None, None, 0, 0, -1
        _data = json.loads(_data_json)
        return _data[0], _data[1], _data[2], _data[3], _data[4]
        return _data[0], _data[1], _data[2], _data[3], _data[4], _data[5]
    # 设置买入点的值
    # buy_single_index 买入信号位
@@ -88,16 +88,18 @@
    # compute_index 计算位置
    # nums 累计纯买额
    @staticmethod
    def set_buy_compute_start_data(code, buy_single_index, buy_exec_index, compute_index, nums, count):
    def set_buy_compute_start_data(code, buy_single_index, buy_exec_index, compute_index, nums, count, max_num_index):
        redis = TradePointManager.__get_redis()
        expire = tool.get_expire()
        _key = "buy_compute_index_info-{}".format(code)
        if buy_single_index is not None:
            redis.setex(_key, expire, json.dumps((buy_single_index, buy_exec_index, compute_index, nums, count)))
            redis.setex(_key, expire,
                        json.dumps((buy_single_index, buy_exec_index, compute_index, nums, count, max_num_index)))
        else:
            _buy_single_index, _buy_exec_index, _compute_index, _nums, _count = TradePointManager.get_buy_compute_start_data(
            _buy_single_index, _buy_exec_index, _compute_index, _nums, _count, _max_num_index = TradePointManager.get_buy_compute_start_data(
                code)
            redis.setex(_key, expire, json.dumps((_buy_single_index, buy_exec_index, compute_index, nums, count)))
            redis.setex(_key, expire,
                        json.dumps((_buy_single_index, buy_exec_index, compute_index, nums, count, max_num_index)))
    # 获取撤买入开始计算的信息
    # 返回数据的内容为:撤销点索引 撤买纯买额 计算的数据索引
@@ -941,8 +943,9 @@
    # 获取下单起始信号
    @classmethod
    def __get_order_begin_pos(cls, code):
        buy_single_index, buy_exec_index, compute_index, num = TradePointManager.get_buy_compute_start_data(code)
        return buy_single_index, buy_exec_index, compute_index, num
        buy_single_index, buy_exec_index, compute_index, num, max_num_index = TradePointManager.get_buy_compute_start_data(
            code)
        return buy_single_index, buy_exec_index, compute_index, num, max_num_index
    @classmethod
    def __save_order_begin_data(self, code, buy_single_index, buy_exec_index, compute_index, num):
@@ -1637,7 +1640,8 @@
    def process_cancel_with_big_num(cls, code, start_index, end_index):
        total_data = local_today_datas[code]
        # 如果无下单信号就无需处理
        buy_single_index, buy_exec_index, compute_index, nums = TradePointManager.get_buy_compute_start_data(code)
        buy_single_index, buy_exec_index, compute_index, nums, max_num_index = TradePointManager.get_buy_compute_start_data(
            code)
        if buy_single_index is None or buy_exec_index is None or buy_exec_index < 0:
            return False, None
        # 判断是否有大单记录
@@ -1926,7 +1930,6 @@
        if process_index is None:
            process_index = end_index
        cls.__save_recod(code, process_index, count)
def __get_time_second(time_str):