| | |
| | | is_trade=True) |
| | | try: |
| | | if blocking: |
| | | return __read_response(request_id, blocking) |
| | | res = __read_response(request_id, blocking) |
| | | else: |
| | | return {"order_ref": order_ref} |
| | | res = {"order_ref": order_ref} |
| | | async_log_util.info(hx_logger_trade_debug, f"下单结果:{res}") |
| | | return res |
| | | finally: |
| | | # huaxin_trade_data_update.add_delegate_list("下单", delay=0.2) |
| | | huaxin_trade_data_update.add_money_list() |
| | |
| | | :param recancel: |
| | | :return: |
| | | """ |
| | | if tool.trade_time_sub(tool.get_now_time_str(), "14:57:00") >= 0 and tool.trade_time_sub(tool.get_now_time_str(),"15:00:01") <= 0: |
| | | if tool.trade_time_sub(tool.get_now_time_str(), "14:57:00") >= 0 and tool.trade_time_sub(tool.get_now_time_str(), |
| | | "15:00:01") <= 0: |
| | | # 集合竞价不撤单 |
| | | return |
| | | |
| | |
| | | "orderActionRef": order_action_ref, |
| | | "orderSysID": orderSysID, "sinfo": sinfo}, request_id=request_id, is_trade=True) |
| | | try: |
| | | return __read_response(request_id, blocking) |
| | | res = __read_response(request_id, blocking) |
| | | async_log_util.info(hx_logger_trade_debug, f"撤单结果:{res}") |
| | | return res |
| | | finally: |
| | | # huaxin_trade_data_update.add_delegate_list("撤单") |
| | | huaxin_trade_data_update.add_money_list() |
| | |
| | | {"type": ClientSocketManager.CLIENT_TYPE_DELEGATE_LIST, |
| | | "can_cancel": 1 if can_cancel else 0}) |
| | | |
| | | return __read_response(request_id, blocking, timeout=timeout) |
| | | res = __read_response(request_id, blocking, timeout=timeout) |
| | | |
| | | async_log_util.info(hx_logger_trade_debug, f"获取委托列表:{res}") |
| | | |
| | | return res |
| | | |
| | | |
| | | # 获取成交列表 |
| | |
| | | """ |
| | | request_id = __request(ClientSocketManager.CLIENT_TYPE_DEAL_LIST, |
| | | {"type": ClientSocketManager.CLIENT_TYPE_DEAL_LIST}) |
| | | return __read_response(request_id, blocking, timeout=timeout) |
| | | res = __read_response(request_id, blocking, timeout=timeout) |
| | | async_log_util.info(hx_logger_trade_debug, f"获取成交列表:{res}") |
| | | return res |
| | | |
| | | |
| | | # todo 获取华鑫持仓列表 后续即可实现仓位管理 |
| | | # 获取持仓列表 |
| | |
| | | """ |
| | | request_id = __request(ClientSocketManager.CLIENT_TYPE_POSITION_LIST, |
| | | {"type": ClientSocketManager.CLIENT_TYPE_POSITION_LIST}) |
| | | return __read_response(request_id, blocking) |
| | | res = __read_response(request_id, blocking) |
| | | async_log_util.info(hx_logger_trade_debug, f"获取持仓结果:{res}") |
| | | return res |
| | | |
| | | |
| | | # todo 获取华鑫账户资金 后续即可实现账户管理 |
| | | # 获取账户资金状况 |
| | |
| | | """ |
| | | request_id = __request(ClientSocketManager.CLIENT_TYPE_MONEY, |
| | | {"type": ClientSocketManager.CLIENT_TYPE_MONEY}) |
| | | return __read_response(request_id, blocking) |
| | | res = __read_response(request_id, blocking) |
| | | async_log_util.info(hx_logger_trade_debug, f"获取账户结果:{res}") |
| | | return res |
| | | |
| | | |
| | | # money = get_money() |
| | | # print(f"money=={money}") |