| | |
| | | import logging |
| | | import multiprocessing |
| | | import time |
| | | |
| | | from huaxin_client.cb import trade_client_for_cb |
| | | from log_module.log import logger_info, printlog |
| | | from trade import huaxin_trade_api |
| | | |
| | | if __name__ == "__main__": |
| | | try: |
| | | q_s_w_t_r, q_s_r_t_w = multiprocessing.Queue(), multiprocessing.Queue() |
| | | huaxin_trade_api.run_pipe_trade(q_s_r_t_w, q_s_w_t_r) |
| | | tradeProcess = multiprocessing.Process( |
| | | target= trade_client_for_cb.run, |
| | | args=(q_s_w_t_r, q_s_r_t_w)) |
| | | tradeProcess.start() |
| | | time.sleep(3) |
| | | printlog("获取委托结果", huaxin_trade_api.get_delegate_list()) |
| | | |
| | | time.sleep(2) |
| | | printlog("获取持仓结果", huaxin_trade_api.get_position_list(True)) |
| | | |
| | | |
| | | |
| | | |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | finally: |
| | | logger_info.debug("程序结束") |
| | | pass |