Administrator
2023-08-31 de34b0a96d71e6ab8eabe2e580c2b94de9065d08
l2/l2_data_manager_new.py
@@ -1021,7 +1021,7 @@
        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m值阈值计算")
        # 买入纯买额统计
        compute_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code,
        new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new = cls.__sum_buy_num_for_order_3(code,
                                                                                                             start_process_index,
                                                                                                             compute_end_index,
                                                                                                             num, count,
@@ -1040,25 +1040,25 @@
                                    is_first_code, False)
            return
        if compute_index is not None:
            l2_log.debug(code, "获取到买入执行位置:{} m值:{} 纯买手数:{} 纯买单数:{} 数据:{} ,量比:{} ", compute_index, threshold_money,
        if new_buy_exec_index is not None:
            l2_log.debug(code, "获取到买入执行位置:{} m值:{} 纯买手数:{} 纯买单数:{} 数据:{} ,量比:{} ", new_buy_exec_index, threshold_money,
                         buy_nums,
                         buy_count, total_datas[compute_index], cls.volume_rate_info[code])
            cls.__save_order_begin_data(code, buy_single_index, compute_index, compute_index,
                         buy_count, total_datas[new_buy_exec_index], cls.volume_rate_info[code])
            cls.__save_order_begin_data(code, buy_single_index, new_buy_exec_index, new_buy_exec_index,
                                        buy_nums, buy_count, max_num_set_new,
                                        cls.volume_rate_info[code][0])
            cls.__LimitUpTimeManager.save_limit_up_time(code, total_datas[compute_index]["val"]["time"])
            cls.__LimitUpTimeManager.save_limit_up_time(code, total_datas[new_buy_exec_index]["val"]["time"])
            cls.__TradePointManager.delete_buy_cancel_point(code)
            l2_log.debug(code, "delete_buy_cancel_point")
            # 直接下单
            ordered = cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code)
            ordered = cls.__buy(code, capture_time, total_datas[new_buy_exec_index], new_buy_exec_index, is_first_code)
            # 数据是否处理完毕
            if compute_index < compute_end_index:
            if new_buy_exec_index < compute_end_index:
                if ordered:
                    cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False)
                    cls.__process_order(code, new_buy_exec_index + 1, compute_end_index, capture_time, is_first_code, False)
                else:
                    cls.__start_compute_buy(code, compute_index + 1, compute_end_index, threshold_money, capture_time,
                    cls.__start_compute_buy(code, new_buy_exec_index + 1, compute_end_index, threshold_money, capture_time,
                                            is_first_code, False)
        else:
            # 未达到下单条件,保存纯买额,设置纯买额
@@ -1248,8 +1248,8 @@
                             buy_nums, threshold_num)
            max_buy_num_set_count = 0
            for i in max_buy_num_set:
                max_buy_num_set_count += total_datas[i]["re"]
            for i1 in max_buy_num_set:
                max_buy_num_set_count += total_datas[i1]["re"]
            # 有撤单信号,且小于阈值
            if buy_nums >= threshold_num and buy_count >= threshold_count and trigger_buy and max_buy_num_set_count >= big_num_count:
                return i, buy_nums, buy_count, None, max_buy_num_set