xinxin
This commit is contained in:
parent
909a46f8be
commit
388f8db2d5
@ -26,10 +26,7 @@ root_path = Path(__file__).parent.parent
|
|||||||
|
|
||||||
# 直接默认使用C:'金长江网上交易汇智版','xiadan.exe'
|
# 直接默认使用C:'金长江网上交易汇智版','xiadan.exe'
|
||||||
path = r'C:\金长江网上交易汇智版\xiadan.exe'
|
path = r'C:\金长江网上交易汇智版\xiadan.exe'
|
||||||
global engine
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306'
|
|
||||||
)
|
|
||||||
class ChangJiangClientTrader:
|
class ChangJiangClientTrader:
|
||||||
"""
|
"""
|
||||||
基于同花顺委托下单程序的"长城证券客户端"自动交易程序
|
基于同花顺委托下单程序的"长城证券客户端"自动交易程序
|
||||||
@ -142,7 +139,10 @@ class ChangJiangClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,10 +21,6 @@ root_path = Path(__file__).parent.parent
|
|||||||
|
|
||||||
path = os.path.join(root_path,'broker_xiadan','东吴证券金融终端独立下单','xiadan.exe')
|
path = os.path.join(root_path,'broker_xiadan','东吴证券金融终端独立下单','xiadan.exe')
|
||||||
|
|
||||||
global engine
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
|
||||||
echo=False)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +156,10 @@ class DongWuClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.logger.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.logger.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,10 +26,6 @@ root_path = Path(__file__).parent.parent
|
|||||||
from config import ssid,password
|
from config import ssid,password
|
||||||
path = r'C:\gfzqrzrq\xiadan.exe'
|
path = r'C:\gfzqrzrq\xiadan.exe'
|
||||||
|
|
||||||
global engine
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306'
|
|
||||||
)
|
|
||||||
|
|
||||||
class GFClientTrader:
|
class GFClientTrader:
|
||||||
"""
|
"""
|
||||||
@ -123,7 +119,10 @@ class GFClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +146,7 @@ class GFClientTrader:
|
|||||||
pywinauto.keyboard.send_keys("{ENTER}")
|
pywinauto.keyboard.send_keys("{ENTER}")
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
self._close_prompt_windows()
|
self._close_prompt_windows()
|
||||||
self._app.window(title_re='核新网上交易系统.*').wait("ready",timeout=60)
|
self._app.window(title_re='核新网上交易系统8.12').wait("ready",timeout=60)
|
||||||
|
|
||||||
|
|
||||||
#关闭弹窗
|
#关闭弹窗
|
||||||
@ -155,7 +154,7 @@ class GFClientTrader:
|
|||||||
# self._turn_off_advertising()
|
# self._turn_off_advertising()
|
||||||
|
|
||||||
#设置主窗口及菜单窗口
|
#设置主窗口及菜单窗口
|
||||||
self.main_wnd = self._app.window(title='核新网上交易系统7.81')
|
self.main_wnd = self._app.window(title='核新网上交易系统8.12')
|
||||||
self.left_wnd = self.main_wnd.window(class_name='AfxWnd140s', control_id=0xC8,found_index=0).window(class_name='SysTreeView32',control_id=0x81)
|
self.left_wnd = self.main_wnd.window(class_name='AfxWnd140s', control_id=0xC8,found_index=0).window(class_name='SysTreeView32',control_id=0x81)
|
||||||
|
|
||||||
def _turn_off_advertising(self):
|
def _turn_off_advertising(self):
|
||||||
|
@ -26,9 +26,7 @@ root_path = Path(__file__).parent.parent
|
|||||||
|
|
||||||
path = os.path.join(root_path,'broker_xiadan','hualong','Tc.exe')
|
path = os.path.join(root_path,'broker_xiadan','hualong','Tc.exe')
|
||||||
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
|
||||||
encoding="utf-8", echo=False)
|
|
||||||
class HLClientTrader:
|
class HLClientTrader:
|
||||||
"""
|
"""
|
||||||
基于"开源证券客户端"自动交易程序
|
基于"开源证券客户端"自动交易程序
|
||||||
@ -165,7 +163,10 @@ class HLClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.logger.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.logger.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,10 +25,7 @@ root_path = Path(__file__).parent.parent
|
|||||||
from config import ssid,password
|
from config import ssid,password
|
||||||
path = r'C:\华泰证券网上交易委托系统\xiadan.exe'
|
path = r'C:\华泰证券网上交易委托系统\xiadan.exe'
|
||||||
|
|
||||||
global engine
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class HTClientTrader:
|
class HTClientTrader:
|
||||||
@ -125,7 +122,10 @@ class HTClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,10 +24,7 @@ from pathlib import Path
|
|||||||
root_path = Path(__file__).parent.parent
|
root_path = Path(__file__).parent.parent
|
||||||
|
|
||||||
path = r'C:\中信建投网上交易极速版(同花顺)\xiadan.exe'
|
path = r'C:\中信建投网上交易极速版(同花顺)\xiadan.exe'
|
||||||
global engine
|
|
||||||
engine = create_engine(
|
|
||||||
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306'
|
|
||||||
)
|
|
||||||
|
|
||||||
class ZXJTClientTrader:
|
class ZXJTClientTrader:
|
||||||
"""
|
"""
|
||||||
@ -122,7 +119,10 @@ class ZXJTClientTrader:
|
|||||||
'IP': proxy_ip,
|
'IP': proxy_ip,
|
||||||
'Port': proxy_port,
|
'Port': proxy_port,
|
||||||
'Location': item['prov'] + ':' + item['city']}])
|
'Location': item['prov'] + ':' + item['city']}])
|
||||||
insert_data_df.to_sql('trade_proxyip', engine, schema='user_center', index=False, if_exists='append')
|
engine_ip = create_engine(
|
||||||
|
'mysql+pymysql://cn_ainvest_db:cn_ainvest_sd3a1@rm-2zewagytttzk6f24xno.mysql.rds.aliyuncs.com:3306/',
|
||||||
|
echo=False)
|
||||||
|
insert_data_df.to_sql('trade_proxyip', engine_ip, schema='user_center', index=False, if_exists='append')
|
||||||
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
self.log.info(f'IP:{proxy_ip} MAC:{new_mac} 已入库')
|
||||||
|
|
||||||
|
|
||||||
@ -367,20 +367,20 @@ class ZXJTClientTrader:
|
|||||||
return pd.DataFrame()
|
return pd.DataFrame()
|
||||||
df_position['证券代码'] = df_position['证券代码'].apply(lambda x: tranTicker(x.strip('=').strip('"')))
|
df_position['证券代码'] = df_position['证券代码'].apply(lambda x: tranTicker(x.strip('=').strip('"')))
|
||||||
|
|
||||||
df_position = df_position[['证券代码','证券名称','当前可拥股数','可用股份','冻结数量','成本价','市价','市值','盈亏','盈亏比例(%)']]
|
df_position = df_position[['证券代码','证券名称','库存数量','可卖数量','冻结数量','成本价','市价','市值','盈亏','盈亏比例(%)']]
|
||||||
|
|
||||||
|
|
||||||
df_position.rename(columns={"证券代码": "Ticker",
|
df_position.rename(columns={"证券代码": "Ticker",
|
||||||
"证券名称": "Ticker_name",
|
"证券名称": "Ticker_name",
|
||||||
"当前可拥股数": "Number_transactions",
|
"库存数量": "Number_transactions",
|
||||||
"可用股份": "cash",
|
"可卖数量": "cash",
|
||||||
"冻结数量": "frozen_quantity",
|
"冻结数量": "frozen_quantity",
|
||||||
"成本价": "cost_price",
|
"成本价": "cost_price",
|
||||||
"市价": "market_price",
|
"市价": "market_price",
|
||||||
"市值": "market_value",
|
"市值": "market_value",
|
||||||
"盈亏": "profit_and_loss",
|
"盈亏": "profit_and_loss",
|
||||||
"盈亏比例(%)": "profit_loss_ratio",
|
"盈亏比例(%)": "profit_loss_ratio",
|
||||||
}, inplace=True)
|
}, inplace=True)
|
||||||
df_position['As_Of_Date'] = datetime.date.today()
|
df_position['As_Of_Date'] = datetime.date.today()
|
||||||
df_position['Account_Name'] = self.account_name
|
df_position['Account_Name'] = self.account_name
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user