From 8de6dc7eade7d88152628167204976dcd5c21270 Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 28 Oct 2025 17:07:44 +0800 Subject: [PATCH] fewfwe --- weex交易/30分钟仿盘交易.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/weex交易/30分钟仿盘交易.py b/weex交易/30分钟仿盘交易.py index b6cffc2..0a565c0 100644 --- a/weex交易/30分钟仿盘交易.py +++ b/weex交易/30分钟仿盘交易.py @@ -175,7 +175,15 @@ class WeexTransaction: if current_minute in [0, 30]: # 判断是否是 新的30分钟了 - time.sleep(10) + if self.page.ele('x://section[text()="仓位(1)"]', timeout=5): + text = self.page.ele( + 'x://*[@id="tradeLimitContainerJS"]/div[2]/div/div[1]/div/div/div/div[5]/div/div/div[2]').text + if "ETH/SUSDT 多" in text: + self.start = 1 + elif "ETH/SUSDT 空" in text: + self.start = -1 + else: + self.start = 0 new_price_datas = self.get_price() if new_price_datas: @@ -187,16 +195,6 @@ class WeexTransaction: new_price_datas1 = sorted(new_price_datas, key=lambda x: x["id"]) kline_1, kline_2, kline_3 = new_price_datas1[-3:] - if self.page.ele('x://section[text()="仓位(1)"]', timeout=15): - text = self.page.ele( - 'x://*[@id="tradeLimitContainerJS"]/div[2]/div/div[1]/div/div/div/div[5]/div/div/div[2]').text - if "ETH/SUSDT 多" in text: - self.start = 1 - elif "ETH/SUSDT 空" in text: - self.start = -1 - else: - self.start = 0 - if self.start == 1: if is_bearish(kline_1) and is_bearish(kline_2): self.page.ele('x://*[contains(text(), "闪电平仓")]').click()