Administrator
2024-08-20 ef948767f634612fe59581077b7adbcb2b7e6f94
L2测试
2个文件已修改
5 ■■■■■ 已修改文件
trade/huaxin_trade_data_update.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/trade_strategy.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin_trade_data_update.py
@@ -45,7 +45,6 @@
                            position_codes = set()
                            # TODO 测试
                            position_codes.add("113565")
                            position_codes.add("601921")
                            need_update_codes = []
                            for d in datas:
                                if d["prePosition"] > 0 and tool.is_can_sell_code(d["securityID"]):
trade/trade_strategy.py
@@ -500,6 +500,8 @@
class MyL2DataCallback(L2DataCallBack):
    def OnL2Order(self, code, origin_datas, timestamp):
        if tool.is_cb_code(code):
            return
        # 保存L2数据
        datas = None
        try:
@@ -526,7 +528,7 @@
            origin_datas.clear()
    def OnL2Transaction(self, code, datas):
        async_log_util.info(hx_logger_l2_transaction, f"{code}#{datas}")
        # async_log_util.info(hx_logger_l2_transaction, f"{code}#{datas}")
        if datas:
            # 获取最近的成交价
            price, time_str = datas[-1][1], l2_huaxin_util.convert_time(datas[-1][3])