Skip to content

Commit 762a6fc

Browse files
committed
Rename ShiPanE to StrategyEase
1 parent c6d2104 commit 762a6fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+232
-232
lines changed

README.rst

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
ShiPanE-Python-SDK
1+
StrategyEase-Python-SDK
22
==================
33

4-
实盘易(ShiPanE)Python SDK,通达信自动化交易 API
4+
策略易(StrategyEase)Python SDK。
55

6-
| 实盘易是\ `爱股网 <http://www.iguuu.com>`__\ 旗下的股票自动化解决方案;提供基于 HTTP 协议的 RESTFul Service,从而管理通达信等交易终端。
6+
| 策略易是\ `爱股网 <http://www.iguuu.com>`__\ 旗下的股票自动化解决方案;提供基于 HTTP 协议的 RESTFul Service,从而管理通达信等交易终端。
77
| 详情见:http://www.iguuu.com/e
8-
| 交流QQ群:11527956 |实盘易-股票自动交易|
8+
| 交流QQ群:11527956 |策略交流|
99
|
1010
1111
.. contents:: **目录**
1212

1313
原理概述
1414
--------
15-
- 实盘易通过调用 WINDOWS API 对通达信进行操作。
16-
- 实盘易提供基于 HTTP 协议的 RESTFul Service/API。
17-
- SDK 对 API 进行了封装(由 shipane_sdk/client.py 中的 Client 类实现)。
15+
- 策略易通过调用 WINDOWS API 对通达信进行操作。
16+
- 策略易提供基于 HTTP 协议的 RESTFul Service/API。
17+
- SDK 对 API 进行了封装(由 strategyease_sdk/client.py 中的 Client 类实现)。
1818
- 本地策略或量化交易平台(目前支持聚宽、米筐、优矿)的模拟交易通过调用 SDK 实现自动下单。
1919

2020
功能介绍
2121
--------
2222

23-
- 简单的实盘易 HTTP API 封装,见 shipane_sdk/client.py
23+
- 简单的策略易 HTTP API 封装,见 strategyease_sdk/client.py
2424
- 多账号自动新股申购(自动打新)
2525
- 多账号自动逆回购
2626
- 定时批量下单
@@ -36,11 +36,11 @@ ShiPanE-Python-SDK
3636
3737
import logging
3838
39-
import shipane_sdk
39+
import strategyease_sdk
4040
4141
logging.basicConfig(level=logging.DEBUG)
4242
43-
client = shipane_sdk.Client(host='localhost', port=8888, key='')
43+
client = strategyease_sdk.Client(host='localhost', port=8888, key='')
4444
account_info = client.get_account('title:monijiaoyi')
4545
print(account_info)
4646
@@ -49,17 +49,17 @@ ShiPanE-Python-SDK
4949
测试用例
5050
--------------
5151

52-
实盘易 HTTP API 封装对应的测试用例见:
52+
策略易 HTTP API 封装对应的测试用例见:
5353

54-
+------------+-------------------------------------------------+
55-
| 查询及下单 | tests/shipane_sdk/test_client.py |
56-
+------------+-------------------------------------------------+
57-
| 客户端管理 | tests/shipane_sdk/test_client_management.py |
58-
+------------+-------------------------------------------------+
59-
| 融资融券 | tests/shipane_sdk/test_client_margin_trading.py |
60-
+------------+-------------------------------------------------+
61-
| 其他 | tests/shipane_sdk/... |
62-
+------------+-------------------------------------------------+
54+
+------------+------------------------------------------------------+
55+
| 查询及下单 | tests/strategyease_sdk/test_client.py |
56+
+------------+------------------------------------------------------+
57+
| 客户端管理 | tests/strategyease_sdk/test_client_management.py |
58+
+------------+------------------------------------------------------+
59+
| 融资融券 | tests/strategyease_sdk/test_client_margin_trading.py |
60+
+------------+------------------------------------------------------+
61+
| 其他 | tests/strategyease_sdk/... |
62+
+------------+------------------------------------------------------+
6363

6464
定时任务调度
6565
--------------
@@ -83,40 +83,40 @@ Windows
8383
- 安装 Python 3.5(建议安装 `Anaconda3-4.2.0 <https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/>`_)
8484
- cmd 中运行
8585

86-
+--------+---------------------------------------------------------------+
87-
| 正式版 | :code:`pip install --no-binary shipane_sdk shipane_sdk` |
88-
+--------+---------------------------------------------------------------+
89-
| 测试版 | :code:`pip install --pre --no-binary shipane_sdk shipane_sdk` |
90-
+--------+---------------------------------------------------------------+
86+
+--------+-------------------------------------------------------------------------+
87+
| 正式版 | :code:`pip install --no-binary strategyease_sdk strategyease_sdk` |
88+
+--------+-------------------------------------------------------------------------+
89+
| 测试版 | :code:`pip install --pre --no-binary strategyease_sdk strategyease_sdk` |
90+
+--------+-------------------------------------------------------------------------+
9191

9292
配置
9393
^^^^
9494

95-
- cmd 中运行::code:`explorer %UserProfile%\.shipane_sdk\config`
95+
- cmd 中运行::code:`explorer %UserProfile%\.strategyease_sdk\config`
9696
- 修改 scheduler.ini 中的配置(建议使用Notepad++)
9797

9898
运行
9999
^^^^
100100

101-
- cmd 下运行::code:`shipane-scheduler`
101+
- cmd 下运行::code:`strategyease-scheduler`
102102

103103
升级
104104
^^^^
105105

106106
- cmd 中运行
107107

108-
+--------+-----------------------------------------------------------------------------------+
109-
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary shipane_sdk shipane_sdk` |
110-
+--------+-----------------------------------------------------------------------------------+
111-
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary shipane_sdk shipane_sdk` |
112-
+--------+-----------------------------------------------------------------------------------+
108+
+--------+---------------------------------------------------------------------------------------------+
109+
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary strategyease_sdk strategyease_sdk` |
110+
+--------+---------------------------------------------------------------------------------------------+
111+
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary strategyease_sdk strategyease_sdk` |
112+
+--------+---------------------------------------------------------------------------------------------+
113113

114114
- 参考 scheduler-template.ini 修改 scheduler.ini
115115

116116
日志
117117
^^^^
118118

119-
- cmd 中运行::code:`explorer %UserProfile%\AppData\Local\爱股网\盘易`
119+
- cmd 中运行::code:`explorer %UserProfile%\AppData\Local\爱股网\略易`
120120

121121
Mac/Linux
122122
~~~~~~~~~
@@ -127,32 +127,32 @@ Mac/Linux
127127
- 安装 Python 3.5
128128
- terminal 中运行
129129

130-
+--------+---------------------------------------------------------------+
131-
| 正式版 | :code:`pip install --no-binary shipane_sdk shipane_sdk` |
132-
+--------+---------------------------------------------------------------+
133-
| 测试版 | :code:`pip install --pre --no-binary shipane_sdk shipane_sdk` |
134-
+--------+---------------------------------------------------------------+
130+
+--------+-------------------------------------------------------------------------+
131+
| 正式版 | :code:`pip install --no-binary strategyease_sdk strategyease_sdk` |
132+
+--------+-------------------------------------------------------------------------+
133+
| 测试版 | :code:`pip install --pre --no-binary strategyease_sdk strategyease_sdk` |
134+
+--------+-------------------------------------------------------------------------+
135135

136136
配置
137137
^^^^
138138

139-
- 修改 ~/.shipane_sdk/config/scheduler.ini
139+
- 修改 ~/.strategyease_sdk/config/scheduler.ini
140140

141141
运行
142142
^^^^
143143

144-
- terminal 中运行::code:`shipane-scheduler:code:`
144+
- terminal 中运行::code:`strategyease-scheduler:code:`
145145

146146
升级
147147
^^^^
148148

149149
- terminal 中运行
150150

151-
+--------+-----------------------------------------------------------------------------------+
152-
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary shipane_sdk shipane_sdk` |
153-
+--------+-----------------------------------------------------------------------------------+
154-
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary shipane_sdk shipane_sdk` |
155-
+--------+-----------------------------------------------------------------------------------+
151+
+--------+---------------------------------------------------------------------------------------------+
152+
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary strategyease_sdk strategyease_sdk` |
153+
+--------+---------------------------------------------------------------------------------------------+
154+
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary strategyease_sdk strategyease_sdk` |
155+
+--------+---------------------------------------------------------------------------------------------+
156156

157157
- 参考 scheduler-template.ini 修改 scheduler.ini
158158

@@ -167,18 +167,18 @@ Mac/Linux
167167
准备工作
168168
^^^^^^^^
169169

170-
- 部署实盘易
170+
- 部署策略易
171171
- 本地测试通过。
172172
- 远程测试通过。
173173

174174
步骤
175175
^^^^
176176

177-
- 下载 `scripts/shipane_sdk_installer.ipynb`_ 并上传至“投资研究”根目录。
177+
- 下载 `scripts/strategyease_sdk_installer.ipynb`_ 并上传至“投资研究”根目录。
178178
- 打开该文件,设置参数:QUANT_NAME = 'joinquant'
179179
- 查看其它参数并根据需要进行修改。
180180
- 点击工具栏中的右箭头运行该文件,并检查窗口中打印的日志。
181-
- 修改 shipane_sdk_config.yaml,升级后需参考 shipane_sdk_config_template.yaml 进行修改。
181+
- 修改 strategyease_sdk_config.yaml,升级后需参考 strategyease_sdk_config_template.yaml 进行修改。
182182
- 修改策略代码,可参考如下示例:
183183

184184
- examples/joinquant/simple\_strategy.py - 基本跟单用法(侵入式设计,不推荐)
@@ -192,9 +192,9 @@ Mac/Linux
192192
- 同步操作根据模拟盘持仓比例对实盘进行调整。
193193
- 同步操作依赖于“可用”资金。请留意配置文件中“撤销全部订单”相关选项。
194194
- “新股申购”不影响“可用”资金,并且不可被撤销,因此不影响同步功能。
195-
- 同步操作依赖于实盘易 API /adjustments;因此也依赖于“查询投资组合”API,使用前请先做好测试及配置。
195+
- 同步操作依赖于策略易 API /adjustments;因此也依赖于“查询投资组合”API,使用前请先做好测试及配置。
196196
- 同步操作使用“市价单”。
197-
- 如遇到策略报错“ImportError: No module named shipane_sdk”,请稍后重试。
197+
- 如遇到策略报错“ImportError: No module named strategyease_sdk”,请稍后重试。
198198
- 量化平台模拟交易运行中升级 SDK,需重启生效。
199199

200200
二. 抓取方式
@@ -205,7 +205,7 @@ Mac/Linux
205205
准备工作
206206
^^^^^^^^
207207

208-
- 部署实盘易
208+
- 部署策略易
209209
- 测试通过。
210210

211211
步骤
@@ -224,14 +224,14 @@ Mac/Linux
224224
准备工作
225225
^^^^^^^^
226226

227-
- 部署实盘易
227+
- 部署策略易
228228
- 本地测试通过。
229229
- 远程测试通过。
230230

231231
步骤
232232
^^^^
233233

234-
- 下载 `scripts/shipane_sdk_installer.ipynb`_ 并上传至“策略研究”根目录。
234+
- 下载 `scripts/strategyease_sdk_installer.ipynb`_ 并上传至“策略研究”根目录。
235235
- 打开该文件,设置参数:QUANT_NAME = 'ricequant'
236236
- 查看其它参数并根据需要进行修改。
237237
- 点击工具栏中的右箭头运行该文件,并检查窗口中打印的日志。
@@ -251,7 +251,7 @@ Mac/Linux
251251
准备工作
252252
^^^^^^^^
253253

254-
- 部署实盘易
254+
- 部署策略易
255255
- 测试通过。
256256

257257
步骤
@@ -276,7 +276,7 @@ Mac/Linux
276276
准备工作
277277
^^^^^^^^
278278

279-
- 部署实盘易
279+
- 部署策略易
280280
- 测试通过。
281281

282282
步骤
@@ -300,7 +300,7 @@ Mac/Linux
300300
准备工作
301301
^^^^^^^^
302302

303-
- 部署实盘易
303+
- 部署策略易
304304
- 测试通过。
305305

306306
步骤
@@ -311,7 +311,7 @@ Mac/Linux
311311
字段要求
312312
^^^^^^^^
313313

314-
见实盘易《用户手册.txt》的“查询投资组合”章节,可通过实盘易菜单“帮助>查看帮助”访问。
314+
见策略易《用户手册.txt》的“查询投资组合”章节,可通过策略易菜单“帮助>查看帮助”访问。
315315

316316
其他语言 SDK
317317
------------
@@ -322,9 +322,9 @@ C# SDK
322322
| 由网友 @YBO(QQ:259219140)开发。
323323
| 见 `ShiPanETradingSDK <http://git.oschina.net/ybo1990/ShiPanETradingSDK>`_
324324
325-
.. |实盘易-股票自动交易| image:: http://pub.idqqimg.com/wpa/images/group.png
325+
.. |策略交流| image:: http://pub.idqqimg.com/wpa/images/group.png
326326
:target: http://shang.qq.com/wpa/qunwpa?idkey=1ce867356702f5f7c56d07d5c694e37a3b9a523efce199bb0f6ff30410c6185d%22
327327

328328
.. _米筐(RiceQuant): http://www.ricequant.com
329329

330-
.. _scripts/shipane_sdk_installer.ipynb: https://raw.githubusercontent.com/sinall/ShiPanE-Python-SDK/master/scripts/shipane_sdk_installer.ipynb
330+
.. _scripts/strategyease_sdk_installer.ipynb: https://raw.githubusercontent.com/sinall/StrategyEase-Python-SDK/master/scripts/strategyease_sdk_installer.ipynb

config/logging-template.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ formatter=default
1818
args=(sys.stdout,)
1919

2020
[handler_file]
21-
class=shipane_sdk.scheduler.FileHandler
21+
class=strategyease_sdk.scheduler.FileHandler
2222
interval=midnight
2323
backupCount=10
2424
formatter=default

config/online-quant/research/shipane_sdk_config_template.yaml renamed to config/online-quant/research/strategyease_sdk_config_template.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *********************************************************
2-
# 实盘易 SDK 配置
2+
# 策略易 SDK 配置
33
# 如无特别说明,配置项修改后,将在策略重启后生效
44
# 注意:
55
# - 请勿在策略运行期间修改结构,比如 id 等关键信息
@@ -20,10 +20,10 @@ proxies:
2020
password: <password>
2121

2222
# *********************************************************
23-
# 实盘易配置
23+
# 策略易配置
2424
# *********************************************************
2525
gateways:
26-
# 实盘易-1 配置
26+
# 策略易-1 配置
2727
- id: gateway-1
2828
# 连接方式
2929
# DIRECT:直连,适用于有公网 IP 的环境
@@ -36,7 +36,7 @@ gateways:
3636
# 代理 ID
3737
# 连接方式为“代理”时需要设置
3838
proxy: default
39-
# 实例 ID,即运行实盘易的计算机名
39+
# 实例 ID,即运行策略易的计算机名
4040
# 连接方式为“代理”时需要设置
4141
instance-id: <instance-id>
4242
# 密钥
@@ -56,7 +56,7 @@ gateways:
5656
# 其中 xxxx 为交易账号或交易账号后半段
5757
query: account:xxxx
5858
# 是否默认?
59-
# 1 个实盘易只允许设置 1 个交易客户端为默认
59+
# 1 个策略易只允许设置 1 个交易客户端为默认
6060
default: true
6161
# 其他资产价值
6262
# 基金及其他非场内资产价值,该项配置用于校验账户
@@ -90,7 +90,7 @@ gateways:
9090
- ^[\d]{5}$
9191
- ^(204|131)
9292
- !!str 888880
93-
# 实盘易-2 配置
93+
# 策略易-2 配置
9494
- id: gateway-2
9595
# 连接方式
9696
connection-method: DIRECT

config/scheduler-template.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232

3333
; *********************************************************
34-
; 实盘易配置
34+
; 策略易配置
3535
; *********************************************************
36-
[ShiPanE]
36+
[StrategyEase]
3737
host=localhost
3838
port=8888
3939
key=
@@ -45,7 +45,7 @@ key=
4545
[ClientAliases]
4646
; client 参数别名定义
4747
; 下面的各个任务可能会用到相同的客户端,使用 client 参数别名可以简化配置
48-
; 取值可以参见实盘易帮助(帮助>查看帮助)
48+
; 取值可以参见策略易帮助(帮助>查看帮助)
4949
client1=account:45678
5050
client2=account:12345
5151

examples/basic_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import logging
44

5-
import shipane_sdk
5+
import strategyease_sdk
66

77
logging.basicConfig(level=logging.DEBUG)
88

9-
client = shipane_sdk.Client(host='localhost', port=8888, key='')
9+
client = strategyease_sdk.Client(host='localhost', port=8888, key='')
1010
account_info = client.get_account('title:monijiaoyi')
1111
print(account_info)

examples/joinquant/advanced_strategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import shipane_sdk
1+
import strategyease_sdk
22

33

44
# 初始化函数,设定要操作的股票、基准等等
@@ -13,7 +13,7 @@ def initialize(context):
1313
def process_initialize(context):
1414
# 创建 StrategyManager 对象
1515
# 参数为配置文件中的 manager id
16-
g.__manager = shipane_sdk.JoinQuantStrategyManagerFactory(context).create('manager-1')
16+
g.__manager = strategyease_sdk.JoinQuantStrategyManagerFactory(context).create('manager-1')
1717

1818

1919
# 每个单位时间(如果按天回测,则每天调用一次,如果按分钟,则每分钟调用一次)调用一次

0 commit comments

Comments
 (0)