| | |
| | | hx_logger_l2_orderdetail, hx_logger_l2_market_data, logger_l2_g_cancel, logger_debug, \ |
| | | logger_system, logger_trade, logger_local_huaxin_l1_trade_info, logger_l2_codes_subscript, logger_l2_radical_buy |
| | | from third_data import block_info, kpl_data_manager, history_k_data_manager, huaxin_l1_data_manager |
| | | from third_data.code_plate_key_manager import KPLCodeJXBlockManager, CodePlateKeyBuyManager |
| | | from third_data.code_plate_key_manager import KPLCodeJXBlockManager, CodePlateKeyBuyManager, RealTimeKplMarketData |
| | | from third_data.history_k_data_util import JueJinApi |
| | | from trade import l2_trade_util, \ |
| | | trade_data_manager, trade_constant, buy_open_limit_up_strategy |
| | |
| | | logger_debug.exception(e) |
| | | |
| | | |
| | | def __recv_pipe_block_in_money(queue_custom_block_in_money: multiprocessing.Queue): |
| | | logger_system.info(f"trade_server __recv_pipe_block_in_money 线程ID:{tool.get_thread_id()}") |
| | | if queue_custom_block_in_money is not None: |
| | | while True: |
| | | try: |
| | | val = queue_custom_block_in_money.get() |
| | | if val: |
| | | in_list, out_list = val[0], val[1] |
| | | RealTimeKplMarketData.set_market_jingxuan_blocks_from_custom(in_list) |
| | | RealTimeKplMarketData.set_market_jingxuan_out_blocks_from_custom(out_list) |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | |
| | | |
| | | # 排得太远撤单 |
| | | def __cancel_buy_for_too_far(): |
| | | while True: |
| | |
| | | |
| | | |
| | | def run(queue_strategy_r_trade_w, queue_l1_w_strategy_r, queue_strategy_w_trade_r, queue_strategy_w_trade_r_for_read, |
| | | queue_l1_trade_w_strategy_r, trade_ipc_addr): |
| | | queue_l1_trade_w_strategy_r, trade_ipc_addr, queue_custom_block_in_money): |
| | | """ |
| | | |
| | | @param queue_strategy_r_trade_w: |
| | |
| | | @param queue_strategy_w_trade_r_for_read: |
| | | @param queue_l1_trade_w_strategy_r: |
| | | @param trade_ipc_addr: 交易IPC地址:(下单ipc地址,撤单ipc地址) |
| | | @param queue_custom_block_in_money: 接收板块流入流出队列 |
| | | @return: |
| | | """ |
| | | logger_system.info(f"trade_server 线程ID:{tool.get_thread_id()}") |
| | |
| | | t1 = threading.Thread(target=lambda: async_log_util.l2_data_log.run_sync(), daemon=True) |
| | | t1.start() |
| | | |
| | | # 读取板块资金流入 |
| | | t1 = threading.Thread(target=lambda: __recv_pipe_block_in_money(queue_custom_block_in_money), daemon=True) |
| | | t1.start() |
| | | |
| | | logger_system.info("create TradeServer") |
| | | t1 = threading.Thread(target=lambda: clear_invalid_client(), daemon=True) |
| | | t1.start() |