Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import TradeX2
- TradeX2.OpenTdx(14, "9.40", 12, 0)
- nQsid = 22 #券商ID
- sHost = "rzjy1.gtja.com" #券商入口
- nPort = 7708
- sVersion = "9.40" #券商最低版本
- nBranchID = 71 #券商分店 ID,可从通达信查
- nAccountType = 8 #信用
- sClientAccount = "账号.C"
- sBrokerAccount = "股东代码"
- sPassword = "密码"
- sTxPassword = "交易密码"
- try:
- client = TradeX2.Logon(nQsid, sHost, nPort, sVersion, nBranchID, nAccountType, sClientAccount, sBrokerAccount, sPassword, sTxPassword)
- except TradeX2.error as err:
- print ("error: ", err)
- TradeX2.CloseTdx()
- sys.exit(-1)
- nCategory = 0
- status, content = client.QueryData(nCategory)
- if status < 0:
- print ("error: " + content)
- else:
- print (content.encode('latin1').decode('gb2312'))
- nCategory = 1
- status, content = client.QueryData(nCategory)
- if status < 0:
- print ("error: " + content)
- else:
- print (content.encode('latin1').decode('gb2312'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement