Skip to content

Commit 2b95ea6

Browse files
shinny-hongyanshinny-chenli
authored andcommitted
Update Version 3.8.0
1 parent 99e6aa2 commit 2b95ea6

22 files changed

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

doc/advanced/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
unanttended.rst
1818
targetpostask2.rst
1919
scheduler.rst
20+
tq_trading_unit.rst

doc/advanced/tq_trading_unit.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. _tq_trading_unit:
2+
3+
============================
4+
tqsdk 多策略使用手册
5+
============================
6+
7+
概述
8+
====
9+
`tqsdk` 提供了 `TqTradingUnit` 账户类型,支持一个实盘账号在多个策略中交易,每个策略交易数据相互隔离
10+
11+
系统配置要求
12+
============
13+
- **Windows**: >= Windows 10
14+
- **Linux**: >= Ubuntu 22.04
15+
16+
安装
17+
====
18+
使用 `TqTradingUnit` 账户类型需要安装 `tqsdk-zq` 包,用来初始化本地环境::
19+
20+
pip install tqsdk-zq
21+
22+
对于 Windows 用户,还需要安装 Microsoft Visual C++ Redistributable,下载地址:
23+
`Microsoft Redistributable <https://aka.ms/vs/17/release/vc_redist.x64.exe>`_
24+
25+
使用流程
26+
========
27+
28+
1. **初始化本地环境**::
29+
30+
tqsdk-zq init --kq-name=xx --kq-password=xx --web-port=xx
31+
32+
- 初始化完成后,控制台会输出多策略管理页的账户、密码以及网址
33+
- 打开浏览器,访问控制台输出的网址
34+
35+
2. **打印多策略控制台地址**::
36+
37+
tqsdk-zq web
38+
39+
- 如果机器重启或者网页打不开了,请执行以上命令
40+
- 进程重新拉起后,控制台会输出管理页网址
41+
42+
3. **访问多策略管理页**:
43+
44+
- 在多策略管理页添加策略组
45+
- 在策略组中添加后端账号
46+
- 在策略组中添加前端号并入金
47+
48+
4. **使用 TqTradingUnit 登录前端账户**::
49+
50+
from tqsdk import TqApi, TqTradingUnit, TqAuth
51+
52+
account = TqTradingUnit(account_id="前端账户", tags=["铜品种策略", "套利策略"])
53+
api = TqApi(account, auth=TqAuth("快期账户", "账户密码"))
54+

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.7.9'
51+
version = u'3.8.0'
5252
# The full version, including alpha/beta/rc tags.
53-
release = u'3.7.9'
53+
release = u'3.8.0'
5454

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

doc/version.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
版本变更
44
=============================
5+
3.8.0 (2025/04/02)
6+
7+
* 新增: :py:class:`~tqsdk.TqTradingUnit` 账户类型,支持多策略交易,详情参考 :ref:`tq_trading_unit`
8+
* 修复: numpy 移除 NaN 常量导致的指标函数执行失败
9+
* 修复: TqAuth 参数类型错误
10+
* docs: 修正部分文档
11+
12+
513
3.7.9 (2025/03/07)
614

715
* docs: 修正天勤 AI 的指向地址

setup.py

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

99
setuptools.setup(
1010
name='tqsdk',
11-
version="3.7.9",
11+
version="3.8.0",
1212
description='TianQin SDK',
1313
author='TianQin',
1414
author_email='tianqincn@gmail.com',

tqsdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name = "tqsdk"
55

66
from tqsdk.api import TqApi
7-
from tqsdk.tradeable import TqAccount, TqZq, TqKq, TqKqStock, TqSim, TqSimStock, TqCtp, TqRohon, TqJees, TqYida
7+
from tqsdk.tradeable import TqAccount, TqZq, TqKq, TqKqStock, TqSim, TqSimStock, TqCtp, TqRohon, TqJees, TqYida, TqTradingUnit
88
from tqsdk.auth import TqAuth
99
from tqsdk.channel import TqChan
1010
from tqsdk.backtest import TqBacktest, TqReplay

tqsdk/__pyinstaller/hook-tqsdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
from PyInstaller.utils.hooks import collect_data_files
2-
datas = collect_data_files('tqsdk', includes=['ctpse', 'web', 'expired_quotes.json.lzma'])
1+
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
2+
datas = collect_data_files('tqsdk', includes=['web', 'expired_quotes.json.lzma'])
3+
hiddenimports = collect_submodules('tqsdk_ctpse')

tqsdk/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.7.9'
1+
__version__ = '3.8.0'

tqsdk/api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
* 提供本地的模拟交易账户,同时完成撮合成交
1111
* 支持回测功能
1212
13-
1413
* PYTHON SDK使用文档: https://doc.shinnytech.com/pysdk/latest/
15-
* 天勤vscode插件使用文档: https://doc.shinnytech.com/pysdk/latest/devtools/vscode.html
16-
* 天勤用户论坛: https://www.shinnytech.com/qa/
1714
"""
1815
__author__ = 'chengzhi'
1916

0 commit comments

Comments
 (0)