| | |
| | | import json |
| | | import logging |
| | | import os |
| | | import threading |
| | | import time |
| | | |
| | | from huaxin_client import command_manager |
| | |
| | | global trade_response |
| | | trade_response = trade_response_ |
| | | |
| | | # 运行日志同步 |
| | | threading.Thread( target=lambda:async_log_util.run_sync(),daemon=True).start() |
| | | |
| | | global tradeCommandManager |
| | | tradeCommandManager = command_manager.TradeCommandManager() |
| | | tradeCommandManager.init(MyTradeActionCallback(), l2pipe, pipe_strategy) |
| | |
| | | if need_cancel: |
| | | # 需要撤单 |
| | | l2_data_manager_new.L2TradeDataProcessor.cancel_buy(code, "G撤撤单", "G撤") |
| | | logger_l2_g_cancel.info(f"{code}-需要撤单:{msg}") |
| | | async_log_util.info(logger_l2_g_cancel, f"{code}-需要撤单:{msg}") |
| | | else: |
| | | logger_l2_g_cancel.info(f"{code}-不需要撤单:{msg}") |
| | | async_log_util.info(logger_l2_g_cancel, f"{code}-不需要撤单:{msg}") |
| | | except Exception as e: |
| | | logger_l2_g_cancel.error(f"{code}-撤单异常:{str(e)}") |
| | | async_log_util.error(logger_l2_g_cancel, f"{code}-撤单异常:{str(e)}") |
| | | |
| | | |
| | | def clear_invalid_client(): |