fewfwe
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from peewee import *
|
||||
|
||||
# 连接到 SQLite 数据库,如果文件不存在会自动创建
|
||||
db = SqliteDatabase(r'C:\Users\27942\Desktop\job\models\database.db')
|
||||
db = SqliteDatabase(r'E:\新建文件夹\lm_job\models\database.db')
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
import requests
|
||||
from DrissionPage import ChromiumPage, ChromiumOptions
|
||||
|
||||
from bit_tools import openBrowser
|
||||
@@ -5,13 +6,20 @@ from models.weex import Weex1, Weex1Hour, Weex15, Weex30
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
bit_port = openBrowser(id="8dcb4f744cf64ab190e465e153088515")
|
||||
# bit_port = openBrowser(id="8dcb4f744cf64ab190e465e153088515")
|
||||
|
||||
response = requests.post(
|
||||
f"http://127.0.0.1:50326/api/browser/start",
|
||||
json={"envId": 146473},
|
||||
headers={
|
||||
"Authorization": f"Bearer asp_174003986c9b0799677c5b2c1adb76e402735d753bc91a91",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
)
|
||||
|
||||
co = ChromiumOptions()
|
||||
co.set_local_port(port=bit_port)
|
||||
co.set_local_port(port=response.json()["data"]["port"])
|
||||
|
||||
co = ChromiumOptions()
|
||||
co.set_local_port(bit_port)
|
||||
|
||||
page = ChromiumPage(addr_or_opts=co)
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ if __name__ == '__main__':
|
||||
#
|
||||
# print(dates)
|
||||
|
||||
dates = [f"2025-07-{i}" for i in range(1, 31)]
|
||||
dates = [f"2025-10-{i}" for i in range(27, 32)]
|
||||
trades, stats = backtest_15m_trend_optimized(dates)
|
||||
|
||||
logger.info("===== 每笔交易详情 =====")
|
||||
|
||||
@@ -127,15 +127,19 @@ class WeexTransaction:
|
||||
time.sleep(1)
|
||||
|
||||
if self.direction == "long" and not self.start:
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},开多")
|
||||
self.page.ele('x://span[normalize-space()="买入开多"]').click()
|
||||
elif self.direction == "short" and not self.start:
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},开空")
|
||||
self.page.ele('x://span[normalize-space()="卖出开空"]').click()
|
||||
elif self.direction == "long" and self.start == -1:
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},反手平空做多")
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').scroll.to_see(center=True)
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').click()
|
||||
time.sleep(3)
|
||||
self.page.ele('x://span[normalize-space()="买入开多"]').click()
|
||||
elif self.direction == "short" and self.start == 1:
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},反手平多做空")
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').scroll.to_see(center=True)
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').click()
|
||||
time.sleep(3)
|
||||
@@ -195,14 +199,16 @@ class WeexTransaction:
|
||||
continue
|
||||
|
||||
new_price_datas1 = sorted(new_price_datas, key=lambda x: x["id"])
|
||||
kline_1, kline_2, kline_3 = new_price_datas1[-3:]
|
||||
self.kline_1, self.kline_2, self.kline_3 = new_price_datas1[-3:]
|
||||
|
||||
if self.start == 1:
|
||||
if is_bearish(kline_1) and is_bearish(kline_2):
|
||||
if is_bearish(self.kline_1) and is_bearish(self.kline_2):
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},平多")
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').scroll.to_see(center=True)
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').click()
|
||||
elif self.start == -1:
|
||||
if is_bullish(kline_1) and is_bullish(kline_2):
|
||||
if is_bullish(self.kline_1) and is_bullish(self.kline_2):
|
||||
print(f"第一根信号:{self.kline_1},{self.kline_2},平空")
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').scroll.to_see(center=True)
|
||||
self.page.ele('x://*[contains(text(), "闪电平仓")]').click()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user