| | |
| | | |
| | | # 撤买 |
| | | def cancel_buy(self, code): |
| | | if constant.TEST: |
| | | return |
| | | self.buy_cancel_lock.acquire() |
| | | code_input = 0 |
| | | try: |
| | | logger_trade_gui.info("开始撤单:code-{}".format(code)) |
| | | win = self.cancel_win |
| | | if win <= 0: |
| | | if win <= 0 or not win32gui.IsWindowVisible(win): |
| | | self.cancel_win = self.getCancelBuyWin() |
| | | win = self.cancel_win |
| | | if win <= 0: |
| | |
| | | name = THSGuiUtil.getText(code_name_win) |
| | | if name is not None: |
| | | name=name.replace(" ","") |
| | | return name |
| | | return tool.strQ2B(name) |
| | | |
| | | @classmethod |
| | | def fill_codes(cls, codes): |
| | |
| | | cls.cancel_distribute_win_for_code(code) |
| | | else: |
| | | code_name = cls.__get_code_name(win) |
| | | #'深振业A' |
| | | if name_codes.get(code_name) != code: |
| | | cls.cancel_distribute_win_for_code(code) |
| | | continue |
| | |
| | | |
| | | |
| | | if __name__ == '__main__': |
| | | THSGuiTrade().buy("002900", "16.18") |
| | | THSGuiTrade().cancel_buy("000419") |
| | | # GUITest().test_distribute() |
| | | # try: |
| | | # THSGuiUtil.set_buy_window_code(0x000112D0, "000333") |