Administrator
2024-04-16 661013fa55978908d5b417aa327b861c912adbcd
添加日志
2个文件已修改
48 ■■■■ 已修改文件
trade/huaxin/huaxin_trade_server.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/data_export_util.py 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py
@@ -1736,7 +1736,6 @@
                    continue
                result = L2TradeSingleDataManager.is_can_place_order(code, d)
                if result and result[0]:
                    l2_log.info(code, logger_l2_trade_buy, f"触发下单:类型-{_type} 数据-{result[1]}")
                    volume_rate = code_volumn_manager.get_volume_rate(code)
                    order_begin_pos = OrderBeginPosInfo(buy_single_index=i,
                                                        buy_exec_index=i,
@@ -1748,6 +1747,9 @@
                                                        sell_info=None,
                                                        threshold_money=0)
                    l2_data_manager_new.L2TradeDataProcessor.save_order_begin_data(code, order_begin_pos)
                    l2_log.debug(code, "获取到买入执行位置:{} 成交数据触发模式:{}",
                                 order_begin_pos.buy_exec_index,
                                 _type)
                    l2_data_manager_new.L2TradeDataProcessor.start_buy(code, total_datas[-1], total_datas[-1]["index"],
                                                                       True)
                    break
utils/data_export_util.py
@@ -216,28 +216,28 @@
        order_no_index_map[int(d[10])] = i
    order_no_indexes = [(k, order_no_index_map[k]) for k in order_no_index_map]
    order_no_indexes.sort(key=lambda x: x[0])
    if sell_nos:
        for sell_info in sell_nos:
            if sell_info[1] * sell_info[2] < 50 * 10000:
                continue
            for i in range(len(order_no_indexes) - 1):
                if order_no_indexes[i][0] < sell_info[0] < order_no_indexes[i + 1][0]:
                    item = []
                    item.append(order_no_indexes[i + 1][1])
                    item.append(l2_huaxin_util.convert_time(sell_info[3][0], with_ms=True))
                    item.append("")
                    item.append(
                        "{}万".format(round(sell_info[1] * sell_info[2] / 10000, 1)))
                    item.append(sell_info[2])
                    item.append(sell_info[1] // 100)
                    item.append("主动卖")
                    item.append(1)
                    item.append(l2_huaxin_util.convert_time(sell_info[4][0], with_ms=True))
                    item.append(None)
                    item.append(sell_info[0])
                    fdatas.insert(order_no_indexes[i + 1][1], (0, None, item))
                    break
    # 不添加主动卖数据
    # if sell_nos:
    #     for sell_info in sell_nos:
    #         if sell_info[1] * sell_info[2] < 50 * 10000:
    #             continue
    #         for i in range(len(order_no_indexes) - 1):
    #             if order_no_indexes[i][0] < sell_info[0] < order_no_indexes[i + 1][0]:
    #                 item = []
    #                 item.append(order_no_indexes[i + 1][1])
    #                 item.append(l2_huaxin_util.convert_time(sell_info[3][0], with_ms=True))
    #                 item.append("")
    #                 item.append(
    #                     "{}万".format(round(sell_info[1] * sell_info[2] / 10000, 1)))
    #                 item.append(sell_info[2])
    #                 item.append(sell_info[1] // 100)
    #                 item.append("主动卖")
    #                 item.append(1)
    #                 item.append(l2_huaxin_util.convert_time(sell_info[4][0], with_ms=True))
    #                 item.append(None)
    #                 item.append(sell_info[0])
    #                 fdatas.insert(order_no_indexes[i + 1][1], (0, None, item))
    #                 break
    return fdatas