Administrator
2024-02-22 9136c3a90074848c4d0254f4e08149a7adda4cc1
bug修复
4个文件已修改
21 ■■■■■ 已修改文件
output/code_info_output.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/l2_trade_test.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/code_plate_key_manager.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
output/code_info_output.py
@@ -94,7 +94,7 @@
        # zyltgb, limit_price, bidding, k_form, code_nature, hot_block, volume_rate, limit_up_time,
        # deal_big_money
        log.logger_debug.info(f"板块热度耗时:{time.time() - __start_time}")
        # log.logger_debug.info(f"板块热度耗时:{time.time() - __start_time}")
        __start_time = time.time()
        ###############################下单信息###############################
@@ -221,7 +221,7 @@
            elif trade_state == trade_manager.TRADE_STATE_BUY_SUCCESS:
                params["trade_data"]["trade_state"]["desc"] = "已成交"
        log.logger_debug.info(f"下单信息耗时:{time.time() - __start_time}")
        # log.logger_debug.info(f"下单信息耗时:{time.time() - __start_time}")
        __start_time = time.time()
        # H撤监听范围
@@ -243,7 +243,7 @@
                    params["trade_data"]["h_cancel"]["datas"].append(
                        (val["time"], val["num"], money_desc(val["num"] * float(val["price"]) * 100),
                         (1 if canceled else 0)))
        log.logger_debug.info(f"H撤监听范围耗时:{time.time() - __start_time}")
        # log.logger_debug.info(f"H撤监听范围耗时:{time.time() - __start_time}")
        __start_time = time.time()
    ##############################主动买,被动买##################################
@@ -260,13 +260,13 @@
    #         {"name": d[1], "code": d[0], "score": d[2], "limit_up": d[3], "open_limit_up": d[4]})
    params["passive_buy_codes"] = params["passive_buy_codes"]
    log.logger_debug.info(f"主动买,被动买耗时:{time.time() - __start_time}")
    # log.logger_debug.info(f"主动买,被动买耗时:{time.time() - __start_time}")
    __start_time = time.time()
    trade_info = __load_trade_record(code, total_datas)
    params["trade_record"] = {"open_limit_up": trade_info[0], "records": trade_info[2]}
    log.logger_debug.info(f"读取交易记录耗时:{time.time() - __start_time}")
    # log.logger_debug.info(f"读取交易记录耗时:{time.time() - __start_time}")
    __start_time = time.time()
    ##############################开盘啦相关信息##################################
@@ -292,7 +292,7 @@
        plate_info.reverse()
        params["kpl_code_info"]["plate"] = [(k[0], k[1], k[2], format_plate_output(k[1])[1]) for k in plate_info]
    log.logger_debug.info(f"开盘啦板块耗时:{time.time() - __start_time}")
    # log.logger_debug.info(f"开盘啦板块耗时:{time.time() - __start_time}")
    __start_time = time.time()
    # 获取代码的历史涨停数据,(涨停原因,日期,板块)
@@ -312,7 +312,7 @@
            params["kpl_code_info"]["today"] = (format_plate_output(d[2]), d[1], plates)
            break
    log.logger_debug.info(f"获取代码的历史涨停数据耗时:{time.time() - __start_time}")
    # log.logger_debug.info(f"获取代码的历史涨停数据耗时:{time.time() - __start_time}")
    __start_time = time.time()
    return params
test/l2_trade_test.py
@@ -84,7 +84,7 @@
                except Exception as e:
                    pass
    # @unittest.skip("跳过此单元测试")
    @unittest.skip("跳过此单元测试")
    def test_trade(self):
        trade_manager.TradeStateManager().open_buy()
        threading.Thread(target=async_log_util.run_sync, daemon=True).start()
@@ -219,7 +219,7 @@
        l2.l2_data_util.local_today_datas[code] = total_datas
        l2.l2_data_util.load_num_operate_map(l2.l2_data_util.local_today_num_operate_map, code, total_datas, True)
    @unittest.skip("跳过此单元测试")
    # @unittest.skip("跳过此单元测试")
    def test_block(self):
        code = "603778"
        # KPLCodeJXBlockManager().load_jx_blocks(code, 23.52,23.62,
third_data/code_plate_key_manager.py
@@ -555,6 +555,7 @@
        # 获取代码的初次涨停时间
        first_limit_up_time = time.time()
        # if limit_up_record_datas:
        for r in limit_up_record_datas:
            if r[3] == code:
                first_limit_up_time = int(r[5])
trade/huaxin/huaxin_trade_server.py
@@ -1339,6 +1339,8 @@
                            l2_data_util.load_l2_data(code)
                            total_datas = l2_data_util.local_today_datas.get(code)
                            trade_index, is_default = transaction_progress.TradeBuyQueue().get_traded_index(code)
                            if trade_index is None:
                                continue
                            # 下单位置
                            place_order_index = SecondCancelBigNumComputer().get_real_place_order_index_cache(code)
                            # 计算信号位置到真实下单位置的总买(不管是否已撤)