Skip to content

Commit 5b28cb8

Browse files
committed
Merge branch 'master' into dev
2 parents e92cd25 + 240b2bd commit 5b28cb8

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

README.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Windows
7777
配置
7878
^^^^
7979

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

8383
运行
@@ -90,18 +90,18 @@ Windows
9090

9191
- cmd 中运行
9292

93-
+--------+-------------------------------------------------------------------------+
94-
| 正式版 | :code:`pip install --upgrade --no-binary shipane_sdk shipane_sdk` |
95-
+--------+-------------------------------------------------------------------------+
96-
| 测试版 | :code:`pip install --upgrade --pre --no-binary shipane_sdk shipane_sdk` |
97-
+--------+-------------------------------------------------------------------------+
93+
+--------+-----------------------------------------------------------------------------------+
94+
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary shipane_sdk shipane_sdk` |
95+
+--------+-----------------------------------------------------------------------------------+
96+
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary shipane_sdk shipane_sdk` |
97+
+--------+-----------------------------------------------------------------------------------+
9898

9999
- 参考 scheduler-template.ini 修改 scheduler.ini
100100

101101
日志
102102
^^^^
103103

104-
- cmd 中运行::code:`explorer %UserProfile%\\AppData\\Local\\爱股网\\实盘易`
104+
- cmd 中运行::code:`explorer %UserProfile%\AppData\Local\爱股网\实盘易`
105105

106106
Mac/Linux
107107
~~~~~~~~~
@@ -133,11 +133,11 @@ Mac/Linux
133133

134134
- terminal 中运行
135135

136-
+--------+-------------------------------------------------------------------------+
137-
| 正式版 | :code:`pip install --upgrade --no-binary shipane_sdk shipane_sdk` |
138-
+--------+-------------------------------------------------------------------------+
139-
| 测试版 | :code:`pip install --upgrade --pre --no-binary shipane_sdk shipane_sdk` |
140-
+--------+-------------------------------------------------------------------------+
136+
+--------+-----------------------------------------------------------------------------------+
137+
| 正式版 | :code:`pip install --upgrade --no-deps --no-binary shipane_sdk shipane_sdk` |
138+
+--------+-----------------------------------------------------------------------------------+
139+
| 测试版 | :code:`pip install --upgrade --pre --no-deps --no-binary shipane_sdk shipane_sdk` |
140+
+--------+-----------------------------------------------------------------------------------+
141141

142142
- 参考 scheduler-template.ini 修改 scheduler.ini
143143

@@ -180,6 +180,7 @@ Mac/Linux
180180
- 同步操作依赖于实盘易 API /adjustments;因此也依赖于“查询投资组合”API,使用前请先做好测试及配置。
181181
- 同步操作使用“市价单”。
182182
- 如遇到策略报错“ImportError: No module named shipane_sdk”,请稍后重试。
183+
- 量化平台模拟交易运行中升级 SDK,需重启生效。
183184

184185
二. 抓取方式
185186
~~~~~~~~~~~~

shipane_sdk/client.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,10 @@ def create_adjustment(self, client=None, request_json=None, timeout=None):
192192
return json
193193

194194
def start_clients(self, timeout=None):
195-
request = Request('PUT', self.__create_url(None, 'clients'))
196-
self.__send_request(request, timeout)
195+
self.__change_clients_status('LOGGED')
197196

198197
def shutdown_clients(self, timeout=None):
199-
request = Request('DELETE', self.__create_url(None, 'clients'))
200-
self.__send_request(request, timeout)
198+
self.__change_clients_status('STOPPED')
201199

202200
def __execute(self, client=None, timeout=None, **kwargs):
203201
if not kwargs.get('type'):
@@ -206,6 +204,12 @@ def __execute(self, client=None, timeout=None, **kwargs):
206204
response = self.__send_request(request)
207205
return response.json()
208206

207+
def __change_clients_status(self, status, timeout=None):
208+
request = Request('PATCH', self.__create_url(None, 'clients'), json={
209+
'status': status
210+
})
211+
self.__send_request(request, timeout)
212+
209213
def __query_new_stocks(self):
210214
DATA_URL = 'http://vip.stock.finance.sina.com.cn/corp/view/vRPD_NewStockIssue.php?page=1&cngem=0&orderBy=NetDate&orderType=desc'
211215
html = lxml.html.parse(DATA_URL)

shipane_sdk/joinquant/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class JoinQuantClient(BaseQuantClient):
14-
BASE_URL = 'https://www.joinquant.net'
14+
BASE_URL = 'https://www.joinquant.com'
1515

1616
def __init__(self, **kwargs):
1717
super(JoinQuantClient, self).__init__('JoinQuant')

shipane_sdk/uqer/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class UqerClient(BaseQuantClient):
12-
BASE_URL = 'https://gw.wmcloud.com'
12+
BASE_URL = 'https://gw.datayes.com'
1313

1414
def __init__(self, **kwargs):
1515
super(UqerClient, self).__init__('Uqer')
@@ -31,7 +31,6 @@ def login(self):
3131
'Origin': self.BASE_URL,
3232
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
3333
}
34-
self._session.get(self.BASE_URL, timeout=self._timeout)
3534
response = self._session.post('{}/usermaster/authenticate/v1.json'.format(self.BASE_URL), data={
3635
'username': self._username,
3736
'password': self._password,

0 commit comments

Comments
 (0)