Exemple #1
0
    def aout_sell_set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_edit_control_keys(self._config.TRADE_SECURITY_CONTROL_ID,
                                     code)

        # wait security input finish
        self.wait(0.1)

        # 设置交易所
        if security.lower().startswith("sz"):
            self._set_stock_exchange_type("深圳A股")
        if security.lower().startswith("sh"):
            self._set_stock_exchange_type("上海A股")

        self.wait(0.1)

        while '-' == self.main.child_window(control_id=1024,
                                            class_name="Static").window_text():
            pass
        rprice = float(
            self.main.child_window(control_id=1024,
                                   class_name="Static").window_text())

        if rprice > price:
            price = rprice

        self._type_edit_control_keys(
            self._config.TRADE_PRICE_CONTROL_ID,
            easyutils.round_price_by_code(price, code),
        )
        self._type_edit_control_keys(self._config.TRADE_AMOUNT_CONTROL_ID,
                                     str(int(amount)))

        return price
Exemple #2
0
    def _set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_keys(self._config.TRADE_SECURITY_CONTROL_ID, code)
        self._type_keys(self._config.TRADE_PRICE_CONTROL_ID,
                        easyutils.round_price_by_code(price, code))
        self._type_keys(self._config.TRADE_AMOUNT_CONTROL_ID, str(int(amount)))
    def _set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_keys(self._config.TRADE_SECURITY_CONTROL_ID, code)

        # wait security input finish
        self._wait(0.1)

        self._type_keys(self._config.TRADE_PRICE_CONTROL_ID,
                        easyutils.round_price_by_code(price, code))
        self._type_keys(self._config.TRADE_AMOUNT_CONTROL_ID, str(int(amount)))
Exemple #4
0
    def _set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_keys(self._config.TRADE_SECURITY_CONTROL_ID, code)

        # wait security input finish
        self._wait(0.1)

        self._type_keys(self._config.TRADE_PRICE_CONTROL_ID, '{BACKSPACE 10}')

        self._type_keys(self._config.TRADE_PRICE_CONTROL_ID,
                        easyutils.round_price_by_code(price, code))

        self._type_keys(self._config.TRADE_AMOUNT_CONTROL_ID, str(int(amount)))
Exemple #5
0
    def _set_trade_params(self, security, price, amount):
        code = security[-6:]
        # 输入代码
        self._type_keys(self._config.TRADE_SECURITY_CONTROL_ID, code)
        # 输入价格
        self._type_keys(
            self._config.TRADE_PRICE_CONTROL_ID,
            easyutils.round_price_by_code(price, code),
        )

        # 输入数量
        self._type_keys(self._config.TRADE_AMOUNT_CONTROL_ID, str(int(amount)))
        
        # 等待股票名称出现
        self._wait_trade_showup(self._config.TRADE_SECURITY_NAME_ID, "Static")
        # 等待股东账号出现
        self._wait_account_showup()
Exemple #6
0
    def aout_buy_set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_edit_control_keys(self._config.TRADE_SECURITY_CONTROL_ID,
                                     code)

        # wait security input finish
        self.wait(0.1)

        # 设置交易所
        if security.lower().startswith("sz"):
            self._set_stock_exchange_type("深圳A股")
        if security.lower().startswith("sh"):
            self._set_stock_exchange_type("上海A股")

        self._type_edit_control_keys(
            self._config.TRADE_PRICE_CONTROL_ID,
            easyutils.round_price_by_code(price, code),
        )
        self._type_edit_control_keys(self._config.TRADE_AMOUNT_CONTROL_ID,
                                     str(int(amount)))
Exemple #7
0
    def _set_trade_params(self, security, price, amount):
        code = security[-6:]

        self._type_edit_control_keys(self._config.TRADE_SECURITY_CONTROL_ID,
                                     code)
        self.wait(0.1)

        if price == 0:
            while '-' == self.main.child_window(
                    control_id=1024, class_name="Static").window_text():
                pass

        price = float(
            self.main.child_window(control_id=1024,
                                   class_name="Static").window_text())

        self._type_edit_control_keys(
            self._config.TRADE_PRICE_CONTROL_ID,
            easyutils.round_price_by_code(price, code),
        )
        self._type_edit_control_keys(self._config.TRADE_AMOUNT_CONTROL_ID,
                                     str(int(amount)))