| | |
| | | return |
| | | return self.__read_result(commands[2], timeout=10) |
| | | |
| | | def position_by_symbol(self, symbol, blocking=True): |
| | | commands = ("get_position_by_symbol", {"symbol": symbol}, self.__create_request_id("get_position_by_symbol")) |
| | | self.command_queue.put_nowait(commands) |
| | | if not blocking: |
| | | return |
| | | return self.__read_result(commands[2], timeout=10) |
| | | |
| | | def get_unfinish_orders(self, blocking=True): |
| | | """ |
| | | 获取委托列表 |
| | |
| | | results = JueJinApi().get_gp_latest_info(symbols, "symbol,sec_name") |
| | | return {x["symbol"]: x["sec_name"] for x in results} |
| | | |
| | | def get_execution_reports(self, blocking=True): |
| | | commands = ("get_execution_reports", {}, |
| | | self.__create_request_id("cancel_order")) |
| | | self.command_queue.put_nowait(commands) |
| | | if not blocking: |
| | | return |
| | | return self.__read_result(commands[2], timeout=10) |
| | | |
| | | def start_read_results(self): |
| | | while True: |
| | | try: |