Skip to content

Commit 41ee293

Browse files
shinny-packshinny-mayanqiong
authored andcommitted
Update Version 3.2.10
1 parent 6b51b4e commit 41ee293

13 files changed

+79
-15
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.9
3+
Version: 3.2.10
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.9'
51+
version = u'3.2.10'
5252
# The full version, including alpha/beta/rc tags.
53-
release = u'3.2.9'
53+
release = u'3.2.10'
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
----------------------------------------------------
88
TqSdk中的合约代码, 统一采用 交易所代码.交易所内品种代码 的格式. 交易所代码为全大写字母, 交易所内品种代码的大小写规范, 遵从交易所规定, 大小写敏感.
99

10-
其中 TqSdk 免费版本提供全部的期货、商品/金融期权和上证50、沪深300和中证500的实时行情
10+
其中 TqSdk 免费版本提供全部的期货、商品/金融期权和上证50、沪深300、中证500和中证1000的实时行情
1111

1212
购买或申请 TqSdk 专业版试用后可提供A股股票的实时和历史行情,具体免费版和专业版的区别,请点击 `天勤量化专业版 <https://www.shinnytech.com/tqsdk_professional/>`_
1313

@@ -54,6 +54,7 @@ SZSE 深圳证券交易所
5454
SSE.000016 - 上证50指数
5555
SSE.000300 - 沪深300指数
5656
SSE.000905 - 中证500指数
57+
SSE.000852 - 中证1000指数
5758
SSE.510050 - 上交所上证50etf
5859
SSE.510300 - 上交所沪深300etf
5960
SZSE.159919 - 深交所沪深300etf

doc/version.rst

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

33
版本变更
44
=============================
5+
3.2.10 (2022/07/20)
6+
7+
* 增加:增加中证 1000 指数,免费用户可获取该指数行情,参考文档 :ref:`mddatas`
8+
* 修复:回测中没有正常更新 quotes 下的 expire_rest_days 字段的问题
9+
* 修复:回测 web_gui 图表没有显示成交标注、持仓线的问题
10+
11+
512
3.2.9 (2022/07/07)
613

714
* 增加:下载 tick 数据时增加 average 列

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_tag(self):
3636

3737
setuptools.setup(
3838
name='tqsdk',
39-
version="3.2.9",
39+
version="3.2.10",
4040
description='TianQin SDK',
4141
author='TianQin',
4242
author_email='tianqincn@gmail.com',

tqsdk/__version__.py

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

tqsdk/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _has_md_grants(self, symbol):
152152
continue
153153
elif symbol.split('.', 1)[0] in ["SSE", "SZSE"] and self._has_feature("sec"):
154154
continue
155-
elif symbol in ["SSE.000016", "SSE.000300", "SSE.000905"] and self._has_feature("lmt_idx"):
155+
elif symbol in ["SSE.000016", "SSE.000300", "SSE.000905", "SSE.000852"] and self._has_feature("lmt_idx"):
156156
continue
157157
else:
158158
raise Exception(f"您的账户不支持查看 {symbol} 的行情数据,需要购买专业版本后使用。升级网址:https://account.shinnytech.com")

tqsdk/data_extension.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class DataExtension(object):
4141

4242
def __init__(self, api):
4343
self._api = api
44-
self._data = {'trade': {}} # 数据截面, 现在的功能只需要记录 trade
44+
self._data = {
45+
'trade': {},
46+
'quotes': {} # 记录 quotes 的 expire_datetime,并不是每一次 diff 更新都会重新发送 expire_datetime,重新 expire_rest_days 时需要这个信息
47+
} # 数据截面, 现在的功能只需要记录 trade
4548
self._diffs = []
4649
self._diffs_paths = set()
4750
self._prototype = {
@@ -109,6 +112,11 @@ async def _md_recv(self, pack):
109112
"""将行情数据和交易数据合并至 self._data """
110113
for d in pack.get("data", []):
111114
self._datetime_state.update_state(d)
115+
if d.get('quotes', None):
116+
_simple_merge_diff(
117+
result=self._data['quotes'],
118+
diff=d['quotes']
119+
)
112120
if d.get('trade', None):
113121
_simple_merge_diff_and_collect_paths(
114122
result=self._data['trade'],
@@ -160,9 +168,7 @@ def _generate_ext_diff(self):
160168

161169
def _update_quotes(self, diff):
162170
for symbol in diff['quotes']:
163-
if not _is_key_exist(diff, path=['quotes', symbol], key=['expire_datetime']):
164-
continue
165-
expire_datetime = diff['quotes'][symbol]['expire_datetime']
171+
expire_datetime = self._data['quotes'].get(symbol, {}).get('expire_datetime', None)
166172
if expire_datetime and expire_datetime == expire_datetime: # 排除 None 和 nan
167173
# expire_rest_days 距离到期日的剩余天数(自然日天数),正数表示距离到期日的剩余天数,0表示到期日当天,负数表示距离到期日已经过去的天数
168174
# 直接修改在 diff 里面的数据,当 diffs 里有多个对同个合约的修改时,保持数据截面的一致

tqsdk/objs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import json
77
import warnings
88

9-
from tqsdk.datetime import _get_expire_rest_days
109
from tqsdk.diff import _get_obj
1110
from tqsdk.entity import Entity
1211
from tqsdk.utils import _query_for_init, _generate_uuid

tqsdk/web/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="web/favicon.ico"><![endif]--><title>tqsdk-python-web</title><link href="web/css/app.d72d8978.css" rel="preload" as="style"><link href="web/css/chunk-vendors.c93e9127.css" rel="preload" as="style"><link href="web/js/app.fc01ac28.js" rel="preload" as="script"><link href="web/js/chunk-vendors.d7fceff6.js" rel="preload" as="script"><link href="web/css/chunk-vendors.c93e9127.css" rel="stylesheet"><link href="web/css/app.d72d8978.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="web/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="web/img/icons/favicon-16x16.png"><link rel="manifest" href="web/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="tqsdk-python-web"><link rel="apple-touch-icon" href="web/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="web/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="web/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but tqsdk web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script>const TqsdkAddress = location.host
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="web/favicon.ico"><![endif]--><title>tqsdk-python-web</title><link href="web/css/app.d72d8978.css" rel="preload" as="style"><link href="web/css/chunk-vendors.c93e9127.css" rel="preload" as="style"><link href="web/js/app.2c843c86.js" rel="preload" as="script"><link href="web/js/chunk-vendors.d7fceff6.js" rel="preload" as="script"><link href="web/css/chunk-vendors.c93e9127.css" rel="stylesheet"><link href="web/css/app.d72d8978.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="web/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="web/img/icons/favicon-16x16.png"><link rel="manifest" href="web/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="tqsdk-python-web"><link rel="apple-touch-icon" href="web/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="web/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="web/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but tqsdk web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script>const TqsdkAddress = location.host
22
const FetchUrl = '/url'</script><script>const GetTqsdkUrl = function () {
33
return new Promise(function (resolve, reject) {
44
fetch(FetchUrl).then(function(response) {
@@ -7,4 +7,4 @@
77
})
88
});
99
})
10-
}</script><div id="app"></div><script src="web/js/chunk-vendors.d7fceff6.js"></script><script src="web/js/app.fc01ac28.js"></script></body></html>
10+
}</script><div id="app"></div><script src="web/js/chunk-vendors.d7fceff6.js"></script><script src="web/js/app.2c843c86.js"></script></body></html>

0 commit comments

Comments
 (0)