Skip to content

Commit 48c48f6

Browse files
shinny-packshinny-mayanqiong
authored andcommitted
Update Version 3.4.0
1 parent 4548361 commit 48c48f6

File tree

15 files changed

+324
-175
lines changed

15 files changed

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

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

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

doc/usage/mddatas.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,29 @@ KQ 快期 (所有主连合约, 指数都归属在这里)
2525
SSWE 上期所仓单
2626
SSE 上海证券交易所
2727
SZSE 深圳证券交易所
28+
GFEX 广州期货交易所
2829
================== ====================================================================
2930

3031
一些合约代码示例::
3132

32-
SHFE.cu1901 - 上期所 cu1901 期货合约
33-
DCE.m1901 - 大商所 m1901 期货合约
34-
CZCE.SR901 - 郑商所 SR901 期货合约
35-
CFFEX.IF1901 - 中金所 IF1901 期货合约
36-
INE.sc2109 - 上期能源 sc2109 期货合约
33+
SHFE.cu1901 - 上期所 cu1901 期货合约
34+
DCE.m1901 - 大商所 m1901 期货合约
35+
CZCE.SR901 - 郑商所 SR901 期货合约
36+
CFFEX.IF1901 - 中金所 IF1901 期货合约
37+
INE.sc2109 - 上期能源 sc2109 期货合约
38+
GFEX.si2301 - 广期所 si2301 期货合约
3739

38-
CZCE.SPD SR901&SR903 - 郑商所 SR901&SR903 跨期合约
39-
DCE.SP a1709&a1801 - 大商所 a1709&a1801 跨期合约
40+
CZCE.SPD SR901&SR903 - 郑商所 SR901&SR903 跨期合约
41+
DCE.SP a1709&a1801 - 大商所 a1709&a1801 跨期合约
42+
GFEX.SP si2308&si2309 - 广期所 si2308&si2309 跨期组合
4043

41-
DCE.m1807-C-2450 - 大商所豆粕期权
42-
CZCE.CF003C11000 - 郑商所棉花期权
43-
SHFE.au2004C308 - 上期所黄金期权
44+
DCE.m1807-C-2450 - 大商所豆粕期权
45+
CZCE.CF003C11000 - 郑商所棉花期权
46+
SHFE.au2004C308 - 上期所黄金期权
4447
CFFEX.IO2002-C-3550 - 中金所沪深300股指期权
45-
INE.sc2109C450 - 上期能源原油期权
48+
INE.sc2109C450 - 上期能源原油期权
49+
GFEX.si2308-C-5800 - 广期所硅期权
50+
4651

4752
KQ.m@CFFEX.IF - 中金所IF品种主连合约
4853
KQ.i@SHFE.bu - 上期所bu品种指数
@@ -67,6 +72,7 @@ SZSE 深圳证券交易所
6772
SZSE.90001355 - 深交所中证500ETF期权
6873
SSE.510500 - 上交所中证500ETF
6974
SSE.10004497 - 上交所中证500ETF期权
75+
SZSE.159901 - 深交所100ETF
7076

7177

7278

doc/version.rst

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

33
版本变更
44
=============================
5+
3.4.0 (2023/04/13)
6+
7+
* 增加:支持国密连接,可以在 :py:meth:`~tqsdk.TqAccount` 构造时指定 sm 参数为 True 来启用.
8+
当启用国密时仅支持: win7 或以上, ubuntu 22.04 或以上, debian 12 或以上
9+
10+
3.3.0 (2022/11/22)
11+
12+
* 增加:支持广州期货交易所 GFEX,如果用户需要交易广期所合约需要升级到此版本以上
13+
514
3.2.12 (2022/10/20)
615

716
* 优化: :py:meth:`~tqsdk.TqApi.query_all_level_finance_options` 增加 ETF 期权标的,文档补充完整 ETF 基金名称

setup.py

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,22 @@
33

44
import setuptools
55

6-
# from py-spy/setup.py
7-
try:
8-
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel, get_platform
9-
10-
class bdist_wheel(_bdist_wheel):
11-
12-
def finalize_options(self):
13-
_bdist_wheel.finalize_options(self)
14-
# Mark us as not a pure python package (we have platform specific ctpse lib)
15-
if self.plat_name != "any":
16-
self.root_is_pure = False
17-
plat_name = (self.plat_name or get_platform()).replace('-', '_').replace('.', '_')
18-
if plat_name == "linux_x86_64" or plat_name == "manylinux1_x86_64":
19-
self.distribution.package_data[""] = ["ctpse/LinuxDataCollect64.so"]
20-
elif plat_name == "win32":
21-
self.distribution.package_data[""] = ["ctpse/WinDataCollect32.dll"]
22-
elif plat_name == "win_amd64":
23-
self.distribution.package_data[""] = ["ctpse/WinDataCollect64.dll"]
24-
25-
def get_tag(self):
26-
# this set's us up to build generic wheels.
27-
python, abi, plat = _bdist_wheel.get_tag(self)
28-
# We don't contain any python source
29-
python, abi = 'py3', 'none'
30-
return python, abi, plat
31-
except ImportError:
32-
bdist_wheel = None
33-
346
with open("README.md", mode="r", encoding='utf-8') as fh:
357
long_description = fh.read()
368

379
setuptools.setup(
3810
name='tqsdk',
39-
version="3.2.12",
11+
version="3.4.0",
4012
description='TianQin SDK',
4113
author='TianQin',
4214
author_email='tianqincn@gmail.com',
4315
long_description=long_description,
4416
long_description_content_type="text/markdown",
4517
url='https://www.shinnytech.com/tqsdk',
46-
packages=setuptools.find_packages(),
47-
zip_safe=False,
18+
packages=setuptools.find_packages(exclude=["tqsdk.test", "tqsdk.test.*"]),
4819
python_requires='>=3.6.4',
4920
install_requires=["websockets>=8.1", "requests", "numpy", "pandas>=1.1.0", "scipy", "simplejson", "aiohttp",
50-
"certifi", "pyjwt", "psutil", "shinny_structlog", "sgqlc", "filelock"],
51-
cmdclass={'bdist_wheel': bdist_wheel},
21+
"certifi", "pyjwt", "psutil", "shinny_structlog", "sgqlc", "filelock", "tqsdk_ctpse", "tqsdk_sm"],
5222
classifiers=[
5323
"Programming Language :: Python :: 3",
5424
"License :: OSI Approved :: Apache Software License",

tqsdk/__version__.py

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

tqsdk/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def get_quote(self, symbol: str) -> Quote:
382382
* INE: 能源交易所(原油)
383383
* SSE: 上交所
384384
* SZSE: 深交所
385+
* GFEX: 广期所
385386
386387
Example1::
387388
@@ -449,6 +450,7 @@ def get_quote_list(self, symbols: List[str]) -> QuoteList:
449450
* INE: 能源交易所(原油)
450451
* SSE: 上交所
451452
* SZSE: 深交所
453+
* GFEX: 广期所
452454
453455
Example::
454456
@@ -1201,7 +1203,7 @@ def insert_order(self, symbol: str, direction: str, offset: str = "", volume: in
12011203
12021204
Example4::
12031205
1204-
# 多账户模式下, 使用不同期货公司交易账户进行下单操作
1206+
# 多账户模式下, 分别获取各账户的成交记录
12051207
from tqsdk import TqApi, TqAuth, TqMultiAccount
12061208
12071209
account1 = TqAccount("H海通期货", "123456", "123456")

tqsdk/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def _get_td_url(self, broker_id, account_id):
117117
if "TQ" not in broker_list[broker_id]["category"]:
118118
raise Exception(f"该期货公司 - {broker_id} 暂不支持 TqSdk 登录,请联系期货公司。")
119119

120-
return broker_list[broker_id]["url"], broker_list[broker_id].get('broker_type', 'FUTURE')
120+
return broker_list[broker_id]["url"], broker_list[broker_id].get('broker_type', 'FUTURE'), broker_list[broker_id].get('smtype'), broker_list[broker_id].get('smconfig')
121121

122122
def _get_md_url(self, stock, backtest):
123123
"""获取行情网关地址"""
@@ -148,7 +148,7 @@ def _has_account(self, account):
148148
def _has_md_grants(self, symbol):
149149
symbol_list = symbol if isinstance(symbol, list) else [symbol]
150150
for symbol in symbol_list:
151-
if symbol.split('.', 1)[0] in ["SHFE", "DCE", "CZCE", "INE", "CFFEX", "KQ", "SSWE"] and self._has_feature("futr"):
151+
if symbol.split('.', 1)[0] in ["SHFE", "DCE", "CZCE", "INE", "CFFEX", "KQ", "SSWE", "GFEX"] and self._has_feature("futr"):
152152
continue
153153
elif symbol.split('.', 1)[0] in ["SSE", "SZSE"] and self._has_feature("sec"):
154154
continue
@@ -162,6 +162,6 @@ def _has_td_grants(self, symbol):
162162
# 对于 opt / cmb / adv 权限的检查由 OTG 做
163163
if symbol.split('.', 1)[0] in ["SSE", "SZSE"] and self._has_feature("sec"):
164164
return True
165-
if symbol.split('.', 1)[0] in ["SHFE", "DCE", "CZCE", "INE", "CFFEX", "KQ"] and self._has_feature("futr"):
165+
if symbol.split('.', 1)[0] in ["SHFE", "DCE", "CZCE", "INE", "CFFEX", "KQ", "GFEX"] and self._has_feature("futr"):
166166
return True
167167
raise Exception(f"您的账户不支持交易 {symbol},需要购买专业版本后使用。升级网址:https://account.shinnytech.com")

0 commit comments

Comments
 (0)