Administrator
2023-07-21 d31976432cba6abf8edfe6dc4b14a3d5747c3749
bug修复
2个文件已修改
15 ■■■■ 已修改文件
trade/huaxin/trade_server.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/trade_huaxin.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py
@@ -147,7 +147,6 @@
                            type_ = data_json["type"]
                            # 记录交易反馈日志
                            hx_logger_trade_callback.info(data_json)
                            sk.sendall(json.dumps({"code": 0}).encode(encoding='utf-8'))
                            # 重新请求委托列表与资金
                            trade_api_server.trade_data_request_queue.put_nowait({"type": "delegate_list"})
                            trade_api_server.trade_data_request_queue.put_nowait({"type": "money"})
trade/trade_huaxin.py
@@ -62,9 +62,17 @@
    huaxin.huaxin_delegate_postion_manager.place_order(code, price, count, last_data_index)
    if not constant.TRADE_ENABLE:
        return
    result = huaxin_trade_api.order(1, code, count, price)
    print("华鑫下单耗时", time.time() - start_time)
    logger_juejin_trade.info(f"{code}:下单耗时{round(time.time() - start_time, 3)}s")
    result = None
    try:
        result = huaxin_trade_api.order(1, code, count, price)
        print("华鑫下单耗时", time.time() - start_time)
        logger_juejin_trade.info(f"{code}:下单耗时{round(time.time() - start_time, 3)}s")
    except Exception as e:
        if str(e).find("超时") >= 0:
            # 此处出现超时,需要通过读取委托列表来设置订单信息
            pass
        else:
            raise e
    if result:
        print("下单结果", result)