Skip to content

Commit c75b0ed

Browse files
shinny-hongyanshinny-chenli
authored andcommitted
Update Version 3.8.3
1 parent 62335b6 commit c75b0ed

File tree

18 files changed

+2421
-2185
lines changed

18 files changed

+2421
-2185
lines changed

PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: tqsdk
3-
Version: 3.8.1
3+
Version: 3.8.3
44
Summary: TianQin SDK
55
Home-page: https://www.shinnytech.com/tqsdk
66
Author: TianQin

doc/advanced/backtest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ TqSdk 并不提供专门的参数优化机制. 您可以按照自己的需求,
6666
target_pos.set_target_volume(3)
6767
except BacktestFinished:
6868
api.close()
69-
print("SHORT=", SHORT, "最终权益=", acc.account.balance) # 每次回测结束时, 输出使用的参数和最终权益
69+
print("SHORT=", SHORT, "最终权益=", acc.get_account().balance) # 每次回测结束时, 输出使用的参数和最终权益
7070

7171

7272
if __name__ == '__main__':

doc/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Add any Sphinx extension module names here, as strings. They can be
1515
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1616
# ones.
17-
extensions = ["nbsphinx", 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.githubpages', 'autodocsumm', ]
17+
extensions = ["nbsphinx", 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.githubpages', 'autodocsumm', 'sphinxcontrib.googleanalytics']
1818
smartquotes = False
1919

2020
# 设置 graphviz_dot 路径
@@ -48,9 +48,9 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = u'3.8.1'
51+
version = u'3.8.3'
5252
# The full version, including alpha/beta/rc tags.
53-
release = u'3.8.1'
53+
release = u'3.8.3'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.
@@ -79,9 +79,9 @@
7979
# html_theme = 'classic'
8080
html_theme = 'sphinx_rtd_theme'
8181

82-
html_theme_options = {
83-
'analytics_id': 'UA-18345151-2',
84-
}
82+
googleanalytics_id = 'G-9SPL7ERCMF'
83+
googleanalytics_enabled = True
84+
8585
# html_sidebars = {
8686
# '**': ['localtoc.html','globaltoc.html','relations.html', 'sourcelink.html', 'searchbox.html'],
8787
# 'using/windows': ['windowssidebar.html', 'searchbox.html'],

doc/demo/base.rst

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
.. _demo_base:
22

33
基本使用
4-
====================================================
4+
==================================================================
55

66
.. contents:: 目录
77

88

99
.. _tutorial-t10:
1010

1111
t10 - 获取实时行情
12-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

1414
.. literalinclude:: ../../tqsdk/demo/tutorial/t10.py
1515
:language: python
@@ -18,7 +18,7 @@ t10 - 获取实时行情
1818
.. _tutorial-t20:
1919

2020
t20 - 识别行情更新
21-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

2323
.. literalinclude:: ../../tqsdk/demo/tutorial/t20.py
2424
:language: python
@@ -27,7 +27,7 @@ t20 - 识别行情更新
2727
.. _tutorial-t30:
2828

2929
t30 - 使用K线/Tick数据
30-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131

3232
.. literalinclude:: ../../tqsdk/demo/tutorial/t30.py
3333
:language: python
@@ -36,7 +36,7 @@ t30 - 使用K线/Tick数据
3636
.. _tutorial-t40:
3737

3838
t40 - 下单/撤单
39-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040

4141
.. literalinclude:: ../../tqsdk/demo/tutorial/t40.py
4242
:language: python
@@ -45,7 +45,7 @@ t40 - 下单/撤单
4545
.. _tutorial-t41:
4646

4747
t41 - 开仓/平仓
48-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4949

5050
.. literalinclude:: ../../tqsdk/demo/tutorial/t41.py
5151
:language: python
@@ -54,7 +54,7 @@ t41 - 开仓/平仓
5454
.. _tutorial-t50:
5555

5656
t50 - 查询交易所合约每日结算价
57-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5858

5959
.. literalinclude:: ../../tqsdk/demo/tutorial/t50.py
6060
:language: python
@@ -63,7 +63,7 @@ t50 - 查询交易所合约每日结算价
6363
.. _tutorial-t51:
6464

6565
t51 - 查询合约成交排名/持仓排名
66-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6767

6868
.. literalinclude:: ../../tqsdk/demo/tutorial/t51.py
6969
:language: python
@@ -72,7 +72,7 @@ t51 - 查询合约成交排名/持仓排名
7272
.. _tutorial-t52:
7373

7474
t52 - 根据合约类型、交易所、品种等条件查询合约
75-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7676

7777
.. literalinclude:: ../../tqsdk/demo/tutorial/t52.py
7878
:language: python
@@ -81,7 +81,7 @@ t52 - 根据合约类型、交易所、品种等条件查询合约
8181
.. _tutorial-t53:
8282

8383
t53 - 查询主连合约对应的标的合约列表
84-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8585

8686
.. literalinclude:: ../../tqsdk/demo/tutorial/t53.py
8787
:language: python
@@ -90,7 +90,7 @@ t53 - 查询主连合约对应的标的合约列表
9090
.. _tutorial-t54:
9191

9292
t54 - 查询合约信息
93-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9494

9595
.. literalinclude:: ../../tqsdk/demo/tutorial/t54.py
9696
:language: python
@@ -99,7 +99,7 @@ t54 - 查询合约信息
9999
.. _tutorial-t55:
100100

101101
t55 - 查询期权合约
102-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103

104104
.. literalinclude:: ../../tqsdk/demo/tutorial/t55.py
105105
:language: python
@@ -108,7 +108,7 @@ t55 - 查询期权合约
108108
.. _tutorial-t56:
109109

110110
t56 - 根据条件查询期权
111-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112112

113113
.. literalinclude:: ../../tqsdk/demo/tutorial/t56.py
114114
:language: python
@@ -117,7 +117,7 @@ t56 - 根据条件查询期权
117117
.. _tutorial-t57:
118118

119119
t57 - 根据条件查询全部的实值、平值、虚值期权
120-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121121

122122
.. literalinclude:: ../../tqsdk/demo/tutorial/t57.py
123123
:language: python
@@ -126,7 +126,7 @@ t57 - 根据条件查询全部的实值、平值、虚值期权
126126
.. _tutorial-t58:
127127

128128
t58 - 针对ETF期权和股指期权查询全部的实值、平值、虚值期权
129-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130

131131
.. literalinclude:: ../../tqsdk/demo/tutorial/t58.py
132132
:language: python
@@ -135,7 +135,7 @@ t58 - 针对ETF期权和股指期权查询全部的实值、平值、虚值期
135135
.. _tutorial-t59:
136136

137137
t59 - 查询指定期权的希腊指标
138-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139139

140140
.. literalinclude:: ../../tqsdk/demo/tutorial/t59.py
141141
:language: python
@@ -144,7 +144,7 @@ t59 - 查询指定期权的希腊指标
144144
.. _tutorial-t60:
145145

146146
t60 - 单均线策略
147-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148148

149149
.. literalinclude:: ../../tqsdk/demo/tutorial/t60.py
150150
:language: python
@@ -153,7 +153,7 @@ t60 - 单均线策略
153153
.. _tutorial-t70:
154154

155155
t70 - 简单均线策略(目标持仓模型)
156-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157157

158158
.. literalinclude:: ../../tqsdk/demo/tutorial/t70.py
159159
:language: python
@@ -162,23 +162,25 @@ t70 - 简单均线策略(目标持仓模型)
162162
.. _tutorial-t71:
163163

164164
t71 - 简单趋势策略
165-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166166

167167
.. literalinclude:: ../../tqsdk/demo/tutorial/t71.py
168168
:language: python
169169

170+
170171
.. _tutorial-t72:
171172

172173
t72 - 隔夜开盘抢单
173-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174175

175176
.. literalinclude:: ../../tqsdk/demo/tutorial/t72.py
176177
:language: python
177178

179+
178180
.. _tutorial-t80:
179181

180182
t80 - 价差回归策略
181-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182184

183185
.. literalinclude:: ../../tqsdk/demo/tutorial/t80.py
184186
:language: python
@@ -187,7 +189,7 @@ t80 - 价差回归策略
187189
.. _tutorial-t90:
188190

189191
t90 - 在主图中画指标线
190-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191193

192194
.. literalinclude:: ../../tqsdk/demo/tutorial/t90.py
193195
:language: python
@@ -196,7 +198,7 @@ t90 - 在主图中画指标线
196198
.. _tutorial-t91:
197199

198200
t91 - 在附图中画指标线
199-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200202

201203
.. literalinclude:: ../../tqsdk/demo/tutorial/t91.py
202204
:language: python
@@ -205,7 +207,7 @@ t91 - 在附图中画指标线
205207
.. _tutorial-t92:
206208

207209
t92 - 主图中画信号线及文字标注
208-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209211

210212
.. literalinclude:: ../../tqsdk/demo/tutorial/t92.py
211213
:language: python
@@ -214,7 +216,7 @@ t92 - 主图中画信号线及文字标注
214216
.. _tutorial-t93:
215217

216218
t93 - 在主图中画线和方框
217-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
219+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218220

219221
.. literalinclude:: ../../tqsdk/demo/tutorial/t93.py
220222
:language: python
@@ -223,7 +225,7 @@ t93 - 在主图中画线和方框
223225
.. _tutorial-t94:
224226

225227
t94 - 在附图中画K线
226-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
228+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
227229

228230
.. literalinclude:: ../../tqsdk/demo/tutorial/t94.py
229231
:language: python
@@ -232,7 +234,7 @@ t94 - 在附图中画K线
232234
.. _tutorial-t95:
233235

234236
t95 - 附图中画K线、线段和方框
235-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
236238

237239
.. literalinclude:: ../../tqsdk/demo/tutorial/t95.py
238240
:language: python
@@ -241,7 +243,7 @@ t95 - 附图中画K线、线段和方框
241243
.. _tutorial-t96:
242244

243245
t96 - 附图中画MACD
244-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
246+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245247

246248
.. literalinclude:: ../../tqsdk/demo/tutorial/t96.py
247249
:language: python
@@ -250,7 +252,7 @@ t96 - 附图中画MACD
250252
.. _underlying_symbol:
251253

252254
underlying_symbol - 获取主连映射主力合约
253-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
255+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
254256

255257
.. literalinclude:: ../../tqsdk/demo/tutorial/underlying_symbol.py
256258
:language: python
@@ -259,15 +261,16 @@ underlying_symbol - 获取主连映射主力合约
259261
.. _tutorial-backtest:
260262

261263
backtest - 回测
262-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
264+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
263265

264266
.. literalinclude:: ../../tqsdk/demo/tutorial/backtest.py
265267
:language: python
266268

269+
267270
.. _tutorial-downloader:
268271

269272
downloader - 下载数据
270-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271274

272275
.. literalinclude:: ../../tqsdk/demo/tutorial/downloader.py
273276
:language: python
@@ -276,7 +279,7 @@ downloader - 下载数据
276279
.. _tutorial-downloader-orders:
277280

278281
downloader_orders - 下载委托单和成交记录
279-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280283

281284
.. literalinclude:: ../../tqsdk/demo/download_orders.py
282285
:language: python
@@ -285,7 +288,7 @@ downloader_orders - 下载委托单和成交记录
285288
.. _tutorial-ta:
286289

287290
ta - 指标计算
288-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
289292

290293
.. literalinclude:: ../../tqsdk/demo/ta.py
291294
:language: python
@@ -294,15 +297,16 @@ ta - 指标计算
294297
.. _tutorial-ta-option:
295298

296299
ta_option - 期权指标计算
297-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298301

299302
.. literalinclude:: ../../tqsdk/demo/ta_option.py
300303
:language: python
301304

305+
302306
.. _tutorial-multiaccount:
303307

304308
multiaccount - 多账户
305-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
309+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
306310

307311
.. literalinclude:: ../../tqsdk/demo/multiaccount.py
308312
:language: python

0 commit comments

Comments
 (0)