fwefwf
This commit is contained in:
Binary file not shown.
@@ -266,25 +266,25 @@ class WeexTransaction:
|
||||
if self.direction == "long":
|
||||
if self.start == 0:
|
||||
self.ding(f"信号:多,开多:{amount}")
|
||||
self.click_safe('x://span[text()="买入/做多"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="买入/做多"]')
|
||||
self.start = 1
|
||||
elif self.start == -1:
|
||||
self.ding(f"信号:多,反手空转多:{amount}")
|
||||
self.click_safe('x://span[text()="市价"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="市价"]')
|
||||
time.sleep(2)
|
||||
self.click_safe('x://span[text()="买入/做多"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="买入/做多"]')
|
||||
self.start = 1
|
||||
|
||||
elif self.direction == "short":
|
||||
if self.start == 0:
|
||||
self.ding(f"信号:空,开空:{amount}")
|
||||
self.click_safe('x://span[text()="卖出/做空"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="卖出/做空"]')
|
||||
self.start = -1
|
||||
elif self.start == 1:
|
||||
self.ding(f"信号:空,反手多转空:{amount}")
|
||||
self.click_safe('x://span[text()="市价"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="市价"]')
|
||||
time.sleep(2)
|
||||
self.click_safe('x://span[text()="卖出/做空"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="卖出/做空"]')
|
||||
self.start = -1
|
||||
|
||||
# -------------------------------------------------------------
|
||||
@@ -359,12 +359,12 @@ class WeexTransaction:
|
||||
try:
|
||||
if self.start == 1 and is_bearish(self.kline_1) and is_bearish(self.kline_2):
|
||||
self.ding("两根大阴线,平多")
|
||||
self.click_safe('x://span[text()="市价"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="市价"]')
|
||||
self.start = 0
|
||||
|
||||
elif self.start == -1 and is_bullish(self.kline_1) and is_bullish(self.kline_2):
|
||||
self.ding("两根大阳线,平空")
|
||||
self.click_safe('x://span[text()="市价"]')
|
||||
self.click_safe('x://span[normalize-space(text()) ="市价"]')
|
||||
self.start = 0
|
||||
except:
|
||||
self.ding("止损平仓错误!", error=True)
|
||||
|
||||
@@ -341,7 +341,7 @@ class WeexTransaction:
|
||||
|
||||
if self.kline_3:
|
||||
# 判断抓取的数据是否正确
|
||||
if self.get_now_time() != self.kline_3["id"]:
|
||||
if self.get_now_time() == self.kline_3["id"]:
|
||||
continue
|
||||
|
||||
new_price_datas = self.get_price()
|
||||
|
||||
Reference in New Issue
Block a user