This commit is contained in:
EDY 2025-07-11 14:30:28 +08:00
parent 9b8cd3c99d
commit 3410f4b0ba
23 changed files with 55 additions and 64 deletions

View File

@ -22,7 +22,7 @@ warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) scripts_path = os.path.dirname(os.path.realpath(__file__))
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)]
path = r'C:\trade_software\国盛证券同花顺新一代\xiadan.exe' path = r'C:\国盛证券同花顺新一代\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -22,7 +22,7 @@ warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) scripts_path = os.path.dirname(os.path.realpath(__file__))
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)]
path = r'C:\trade_software\goldsun\TdxW.exe' path = r'C:\goldsun\TdxW.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -22,7 +22,7 @@ warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) scripts_path = os.path.dirname(os.path.realpath(__file__))
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)]
path = r'C:\trade_software\e海通财独立交易\AlternateTradeSys5.18.73\xiadan.exe' path = r'C:\e海通财独立交易\AlternateTradeSys5.18.73\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -22,7 +22,7 @@ warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) scripts_path = os.path.dirname(os.path.realpath(__file__))
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)]
path = r'C:\trade_software\恒泰证券网上交易独立委托\xiadan.exe' path = r'C:\恒泰证券网上交易独立委托\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
@ -96,7 +96,7 @@ class HENGTAIClientTrader:
set_proxy(proxy_ip,proxy_port) set_proxy(proxy_ip,proxy_port)
self.log.info('全局代理设置成功') self.log.info('全局代理设置成功')
self._app = pywinauto.Application().start(self.path) self._app = pywinauto.Application().start(self.path)
time.sleep(0.5) time.sleep(0.5)
self._app.top_window().Edit1.type_keys(self.securities_name) self._app.top_window().Edit1.type_keys(self.securities_name)

View File

@ -22,7 +22,7 @@ warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) scripts_path = os.path.dirname(os.path.realpath(__file__))
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)]
path = r'C:\trade_software\华福证券独立下单\xiadan.exe' path = r'C:\华福证券独立下单\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -19,10 +19,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\华鑫同花顺独立下单\xiadan.exe' path = r'C:\华鑫同花顺独立下单\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -17,10 +17,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\华鑫同花顺独立下单(奇点)\xiadan.exe' path = r'C:\华鑫同花顺独立下单(奇点)\xiadan.exe'
class HuaXinClientTrader: class HuaXinClientTrader:

View File

@ -19,10 +19,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\江海证券同花顺独立下单\xiadan.exe' path = r'C:\江海证券同花顺独立下单\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -19,10 +19,10 @@ from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\金元证券金融终端2.0\xiadan.exe' path = r'C:\金元证券金融终端2.0\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -20,10 +20,10 @@ from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\开源证券独立下单\xiadan.exe' path = r'C:\开源证券独立下单\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -17,10 +17,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\平安证券智投版\xiadan.exe' path = r'C:\平安证券智投版\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -19,10 +19,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\sywgtonghuashun\xiadan.exe' path = r'C:\sywgtonghuashun\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -18,10 +18,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\万和证券财智通金融终端\xiadan.exe' path = r'C:\万和证券财智通金融终端\xiadan.exe'
class WanHeClientTrader: class WanHeClientTrader:

View File

@ -18,10 +18,10 @@ from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\xyzqzhb\xiadan.exe' path = r'C:\xyzqzhb\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -20,10 +20,10 @@ from config import ssid,password
from tools import * from tools import *
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\双子星金融终端独立交易-中国银河证券\xiadan.exe' path = r'C:\双子星金融终端独立交易-中国银河证券\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -20,10 +20,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\中山赢者专业版\xiadan.exe' path = r'C:\中山赢者专业版\xiadan.exe'
class ZSZQClientTrader: class ZSZQClientTrader:

View File

@ -19,10 +19,10 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\zhongyou\xiadan.exe' path = r'C:\zhongyou\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',

View File

@ -19,10 +19,10 @@ from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\zd_zsone\TdxW.exe' path = r'C:\zd_zsone\TdxW.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -19,7 +19,6 @@ import datetime
from tools import * from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__))
from pathlib import Path from pathlib import Path
root_path = Path(__file__).parent.parent root_path = Path(__file__).parent.parent

View File

@ -20,10 +20,10 @@ from tools import *
from config import ssid,password from config import ssid,password
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
scripts_path = os.path.dirname(os.path.realpath(__file__)) from pathlib import Path
root_path = scripts_path[:scripts_path.find(project_name)+len(project_name)] root_path = Path(__file__).parent.parent
path = r'C:\trade_software\zxzq\xiadan.exe' path = r'C:\zxzq\xiadan.exe'
engine = create_engine( engine = create_engine(
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/', 'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
encoding="utf-8", echo=False) encoding="utf-8", echo=False)

View File

@ -188,6 +188,12 @@ class Trade:
elif self.broker == '国盛' or self.broker == '国盛证券': elif self.broker == '国盛' or self.broker == '国盛证券':
from autobasic import guosheng_clienttrader from autobasic import guosheng_clienttrader
user = guosheng_clienttrader.GuoShengClientTrader(self.user) user = guosheng_clienttrader.GuoShengClientTrader(self.user)
elif self.broker == '长江' or self.broker == '长江证券':
from autobasic import cj_clienttrader
user = cj_clienttrader.ChangJiangClientTrader(self.user)
elif self.broker == '江海' or self.broker == '江海证券':
from autobasic import jh_clienttrader
user = jh_clienttrader.JHClientTrader(self.user)
else: else:
self.log.error('暂不支持该券商') self.log.error('暂不支持该券商')
return user return user

View File

@ -181,7 +181,7 @@ if __name__ == '__main__':
# #
# userlist = ['13708491492','138187729 # userlist = ['13708491492','138187729
userlist = [ '13653488300'] userlist = [ '18636191815']
print(userlist) print(userlist)
for user in userlist: for user in userlist:
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))

View File

@ -97,12 +97,6 @@ class auto_trade:
logger.info(user) logger.info(user)
try: try:
self.trade_main(user) self.trade_main(user)
writer = ExcelDataWriter()
writer.update_latest_record(
status='成功',
remarks='实盘数据',
risk_response=''
)
logger.info(f'{user}交易已经完成') logger.info(f'{user}交易已经完成')
except Exception as er: except Exception as er:
@ -119,14 +113,6 @@ class auto_trade:
else: else:
logger.error('交易错误') logger.error('交易错误')
logger.error(er) logger.error(er)
#
writer = ExcelDataWriter()
writer.update_latest_record(
status='失败',
remarks='实盘数据',
risk_response=str(er)
)
continue continue