Skip to content

Commit 9804fd3

Browse files
Update Version 3.8.5
1 parent acf7c7b commit 9804fd3

20 files changed

+323
-67
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.3
3+
Version: 3.8.5
44
Summary: TianQin SDK
55
Home-page: https://www.shinnytech.com/tqsdk
66
Author: TianQin

doc/advanced/gui.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
:language: python
1616

1717

18-
在两个线程中分别运行Gui和TqSdk
19-
-------------------------------------------------
20-
参见示例程序 multi_thread.py.
21-
22-
.. literalinclude:: ../../tqsdk/demo/gui/multi_thread.py
23-
:language: python
24-
25-
2618
在TqSdk任务中驱动Gui消息循环
2719
-------------------------------------------------
2820
参见示例程序 loop_integrate.py.

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = u'3.8.3'
51+
version = u'3.8.5'
5252
# The full version, including alpha/beta/rc tags.
53-
release = u'3.8.3'
53+
release = u'3.8.5'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.

doc/dev_framework.rst

Lines changed: 103 additions & 0 deletions
Large diffs are not rendered by default.

doc/dev_general.rst

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
.. _dev_general:
2+
3+
原则与规范
4+
====================================================
5+
6+
TqSdk设计原则
7+
----------------------------------------------------
8+
9+
不预设用户策略模型
10+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
我们深刻认识到, 量化交易是一个充满竞争与创新的领域,成功的用户总是在不断构思和尝试全新的理念与模型. 在这方面, 用户比我们知道得更多, 走得也更快. 因此, 我们在设计TqSdk时, 总是尽力避免对用户的模型结构做限定, 而是专注于为用户提供通用性的资源和能力.
12+
13+
我们的以下设计决策遵循了此原则:
14+
15+
* 不提供策略类模板, 只以示例程序方式展示各类策略应用
16+
* 一个策略程序中可以任意获取数据和发出指令
17+
* 允许用户在一个程序中使用任意多个TqApi实例
18+
19+
20+
保持用户代码简单
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
我们对TqSdk的一个设计目标是尽量让用户的代码与需求方案保持一致(顺序相同, 篇幅相当).
23+
24+
我们的以下设计决策遵循了此原则:
25+
26+
* 不使用多线程, 避免用户处理线程同步问题
27+
* 不使用回调模型, 避免用户维护状态机状态变量
28+
* 提供专门的调仓工具
29+
* 实盘/模拟/回测/复盘 几种不同运行模式切换, 只需要在代码中做单点修改
30+
31+
32+
行为可验证
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
作为TqSdk库质量管控的关键措施, 我们要求 TqSdk 在运行时可以记录完整的输入信息, 以确保发生问题时可以稳定重现问题和定位原因. 我们做了这些决定:
35+
36+
* 以数据流衔接库中的各组件
37+
* TqSdk 的日志文件完整记录收到的全部数据包
38+
* 专门构建了一个单元测试框架, 可以直接用日志作为测试用例输入
39+
40+
41+
相关知识与技能
42+
----------------------------------------------------
43+
TqSdk 的开发涉及以下知识点,您可能需要先学习它们,才能更好的理解和改进TqSdk的代码
44+
45+
* 金融相关业务知识
46+
47+
TqSdk是用于金融交易领域的专用软件包。我们假定用户和开发者都已经具备相应的基础知识,在TqSdk的文档中不再详加解释。
48+
49+
* python asyncio
50+
51+
TqSdk 的代码大量依赖 python asyncio 机制. asyncio 的编程模型与传统 python 程序差异很大. 我们对于TqSdk的使用者尽量隐藏了 asyncio 相关概念, 允许用户在不了解 asyncio 的情况下实现绝大多数业务需求. 但是对于开发者, 若不了解 asyncio, 在理解 TqSdk 内部代码实现时会非常困难。
52+
53+
* Diff协议
54+
55+
TqSdk 并不是一个 all-in-one 的包, 它的能力有赖于一系列后台服务的支持. DIFF协议是 TqSdk 与后台服务间通讯的主要协议, 开发者需对 DIFF 有所理解, 才能掌握 TqSdk 的内部实现
56+
57+
* Pandas/Numpy
58+
59+
Pandas/Numpy 是非常优秀的 python 数值计算库. TqSdk 利用这些库完成K线序列数据的存储和操作.
60+
61+
62+
代码风格
63+
----------------------------------------------------
64+
TqSdk的代码风格遵循 PEP8 规范.
65+
66+

doc/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ TianQin Python Sdk User Guide
2222
tq_trading_unit.rst
2323
advanced/index.rst
2424
tqsdk_cursor.rst
25-
dev/index.rst
25+
dev_general.rst
26+
dev_framework.rst
2627
profession.rst
2728
enterprise.rst
2829
qa.rst

doc/intro.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ TqSdk 是一个由 `信易科技 <https://www.shinnytech.com>`_ 发起并贡献
3636
----------------------------------------------------
3737
.. raw:: html
3838

39-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="761px" viewBox="-0.5 -0.5 761 221" style="max-width:100%;max-height:221px;"><defs/><g><path d="M 620 60 L 620 40" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><a xlink:href="https://github.com/shinnytech/open-md-gateway"><rect x="480" y="60" width="280" height="40" fill="none" stroke="#d6b656"/><g transform="translate(569.5,66.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="100" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 102px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><div><a href="https://github.com/shinnytech/open-md-gateway">Open Md Gateway</a></div><div><a href="https://github.com/shinnytech/open-md-gateway">行情网关</a></div></div></div></foreignObject><text x="50" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a><a xlink:href="https://github.com/shinnytech/open-trade-gateway"><rect x="0" y="60" width="280" height="40" fill="none" stroke="#d6b656"/><g transform="translate(82.5,66.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="114" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 116px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><a href="https://github.com/shinnytech/open-trade-gateway">Open Trade Gateway<br />交易中继网关</a><br /></div></div></foreignObject><text x="57" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a><rect x="0" y="0" width="280" height="40" fill="none" stroke="#36393d"/><g transform="translate(84.5,6.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="110" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 110px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">期货公司交易系统<br />CTP / FEMAS / UFX<br /></div></div></foreignObject><text x="55" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">期货公司交易系统&lt;br&gt;CTP / FEMAS / UFX&lt;br&gt;</text></switch></g><rect x="480" y="0" width="280" height="40" fill="none" stroke="#36393d"/><g transform="translate(577.5,13.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="84" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 85px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">交易所行情系统<br /></div></div></foreignObject><text x="42" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">交易所行情系统&lt;br&gt;</text></switch></g><path d="M 140 60 L 140 40" fill="none" stroke="#000000" stroke-miterlimit="10"/><path d="M 380 120 L 140 100" fill="none" stroke="#000000" stroke-miterlimit="10"/><path d="M 380 120 L 620 100" fill="none" stroke="#000000" stroke-miterlimit="10"/><a xlink:href="http://doc.shinnytech.com/diff/latest/"><rect x="0" y="120" width="760" height="40" rx="6" ry="6" fill="none" stroke="#b85450"/><g transform="translate(352.5,133.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="54" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 55px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><a href="https://github.com/shinnytech/diff">DIFF 协议</a></div></div></foreignObject><text x="27" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a><path d="M 380 180 L 380 160" fill="none" stroke="#000000" stroke-miterlimit="10"/><a xlink:href="https://github.com/shinnytech/tqsdk-python"><rect x="320" y="180" width="120" height="40" fill="#dae8fc" stroke="#6c8ebf"/><g transform="translate(362.5,193.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="34" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 36px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><a href="https://github.com/shinnytech/tqsdk-python">TqSdk</a><br /></div></div></foreignObject><text x="17" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a></g></svg>
39+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="761px" viewBox="-0.5 -0.5 761 221" style="max-width:100%;max-height:221px;"><defs/><g><path d="M 620 60 L 620 40" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="480" y="60" width="280" height="40" fill="none" stroke="#d6b656"/><g transform="translate(569.5,66.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="100" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 102px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><div>Open Md Gateway</div><div>行情网关</div></div></div></foreignObject><text x="50" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="0" y="60" width="280" height="40" fill="none" stroke="#d6b656"/><g transform="translate(82.5,66.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="114" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 116px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">Open Trade Gateway<br />交易中继网关<br /></div></div></foreignObject><text x="57" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g><rect x="0" y="0" width="280" height="40" fill="none" stroke="#36393d"/><g transform="translate(84.5,6.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="110" height="26" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 110px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">期货公司交易系统<br />CTP / FEMAS / UFX<br /></div></div></foreignObject><text x="55" y="19" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">期货公司交易系统&lt;br&gt;CTP / FEMAS / UFX&lt;br&gt;</text></switch></g><rect x="480" y="0" width="280" height="40" fill="none" stroke="#36393d"/><g transform="translate(577.5,13.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="84" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 85px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">交易所行情系统<br /></div></div></foreignObject><text x="42" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">交易所行情系统&lt;br&gt;</text></switch></g><path d="M 140 60 L 140 40" fill="none" stroke="#000000" stroke-miterlimit="10"/><path d="M 380 120 L 140 100" fill="none" stroke="#000000" stroke-miterlimit="10"/><path d="M 380 120 L 620 100" fill="none" stroke="#000000" stroke-miterlimit="10"/><a xlink:href="http://doc.shinnytech.com/diff/latest/"><rect x="0" y="120" width="760" height="40" rx="6" ry="6" fill="none" stroke="#b85450"/><g transform="translate(352.5,133.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="54" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 55px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><a href="https://github.com/shinnytech/diff">DIFF 协议</a></div></div></foreignObject><text x="27" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a><path d="M 380 180 L 380 160" fill="none" stroke="#000000" stroke-miterlimit="10"/><a xlink:href="https://github.com/shinnytech/tqsdk-python"><rect x="320" y="180" width="120" height="40" fill="#dae8fc" stroke="#6c8ebf"/><g transform="translate(362.5,193.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="34" height="12" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 36px; white-space: nowrap; overflow-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;"><a href="https://github.com/shinnytech/tqsdk-python">TqSdk</a><br /></div></div></foreignObject><text x="17" y="12" fill="#000000" text-anchor="middle" font-size="12px" font-family="Helvetica">[Not supported by viewer]</text></switch></g></a></g></svg>
4040

41-
* `行情网关 (Open Md Gateway) <https://github.com/shinnytech/open-md-gateway>`_ 负责提供实时行情和历史数据
42-
* `交易中继网关 (Open Trade Gateway) <https://github.com/shinnytech/open-trade-gateway>`_ 负责连接到期货公司交易系统
41+
* 行情网关 (Open Md Gateway) 负责提供实时行情和历史数据
42+
* 交易中继网关 (Open Trade Gateway) 负责连接到期货公司交易系统
4343
* 这两个网关统一以 `Diff协议 <https://doc.shinnytech.com/diff/latest>`_ 对下方提供服务
4444
* TqSdk按照Diff协议连接到行情网关和交易中继网关, 实现行情和交易功能
4545

@@ -48,10 +48,10 @@ TqSdk 是一个由 `信易科技 <https://www.shinnytech.com>`_ 发起并贡献
4848
----------------------------------------------------
4949
TqSdk 提供的功能可以支持从简单到复杂的各类策略程序.
5050

51-
* 提供当前所有可交易合约从上市开始的 **全部Tick数据和K线数据**
52-
* 支持数十家期货公司的 **实盘交易**
53-
* 支持 **模拟交易**
54-
* 支持 **Tick级和K线级回测**, 支持 **复杂策略回测**
51+
* 提供当前所有可交易合约从上市开始的 :ref:`全部Tick数据和K线数据 <mddatas>`
52+
* 支持数十家期货公司的 `实盘交易 <https://www.shinnytech.com/articles/reference/tqsdk-brokers>`_
53+
* 支持 **模拟交易** :py:class:`~tqsdk.tradeable.otg.tqkq.TqKq`
54+
* 支持 :ref:`Tick级和K线级回测 <backtest>`, 支持 **复杂策略回测**
5555
* 提供近百个 **技术指标函数及源码**
5656
* 用户无须建立和维护数据库, 行情和交易数据全在 **内存数据库** , 无访问延迟
5757
* 优化支持 **pandas** 和 **numpy** 库

doc/quickstart.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -277,21 +277,6 @@ klines是一个pandas.DataFrame对象. 跟 api.get_quote() 一样, api.get_kline
277277

278278

279279

280-
TqSdk AI 助手
281-
-------------------------------------------------
282-
TqSdk 基于先进的大语言模型和常见天勤问题资料库,提供了新一代的 AI 助手
283-
284-
解释函数,编写demo策略,分析代码报错原因,它都有不错的表现 `点击使用 <https://www.shinnytech.com/tianqin/>`_
285-
286-
.. figure:: images/llm_pic1.png
287-
.. figure:: images/llm_pic2.png
288-
.. figure:: images/llm_pic3.png
289-
.. figure:: images/llm_pic4.png
290-
.. figure:: images/llm_pic5.png
291-
.. figure:: images/llm_pic6.png
292-
.. figure:: images/llm_pic7.png
293-
294-
295280
TqSdk 学习视频
296281
-------------------------------------------------
297282
TqSdk 提供简单易懂的十分钟上手视频 `供用户学习 <https://www.shinnytech.com/tqsdkquickstart/>`_

doc/usage/shinny_account.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
用快期账户来实盘交易
2121
-------------------------------------------------
22-
对于 TqSdk 免费版,每个快期账户支持最多绑定一个实盘账户,而天勤量化专业版支持一个快期账户绑定任意多个实盘账户
22+
每个快期账户支持最多绑定三个实盘账户
2323

2424
快期账户会在用户使用实盘账户时自动进行绑定,直到该快期账户没有能绑定实盘账户的名额::
2525

@@ -39,7 +39,7 @@
3939

4040
.. figure:: ../images/user_web_management.png
4141

42-
如需一个快期账户支持更多的实盘账户,请联系工作人员进行批量购买 `天勤量化专业版 <https://www.shinnytech.com/tqsdk-buy/>`_
42+
如需一个快期账户支持更多的实盘账户,请联系工作人员进行批量购买
4343

4444

4545

0 commit comments

Comments
 (0)