forked from haoliu1706/test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path说明.txt
43 lines (31 loc) · 1.17 KB
/
说明.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
1.只支持32位Python
2.Order.dll 要放在当前目录
3.助手和交易软件要打开
软件是下载别人破解的 风险自己承担
#股票自动交易助手 Python 自动下单使用 例子
#把此脚本和 StockOrderApi.py Order.dll 放到你自己编写的脚本同一目录
from StockOrderApi import *
#买入测试
#Buy(u"600000" , 100, 0, 1, 0)
#卖出测试,是持仓股才会有动作
#Sell(u"000100" , 100, 0, 1, 0)
#账户信息
print("股票自动交易接口测试")
print("账户信息")
print("--------------------------------")
arrAccountInfo = ["总资产", "可用资金", "持仓总市值", "总盈利金额", "持仓数量"];
for i in range(0, len(arrAccountInfo)):
value = GetAccountInfo( u"" , i, 0)
print ("%s %f "%(arrAccountInfo[i], value))
print("--------------------------------")
print(" ")
print("股票持仓")
print("--------------------------------")
#取出所有的持仓股票代码,结果以 ','隔开的
allStockCode = GetAllPositionCode(0)
allStockCodeArray = allStockCode.split(',')
for i in range(0, len(allStockCodeArray)):
vol = GetPosInfo( allStockCodeArray[i] , 0 , 0)
changeP = GetPosInfo( allStockCodeArray[i] , 4 , 0)
print ("%s %d %.2f%%"%(allStockCodeArray[i], vol, changeP))
print("--------------------------------")