Skip to content

Commit

Permalink
Update Version 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
shinny-pack authored and shinny-mayanqiong committed May 18, 2023
1 parent 4393c9f commit 69c88fb
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 10 deletions.
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tqsdk
Version: 3.4.1
Version: 3.4.2
Summary: TianQin SDK
Home-page: https://www.shinnytech.com/tqsdk
Author: TianQin
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = u'3.4.1'
version = u'3.4.2'
# The full version, including alpha/beta/rc tags.
release = u'3.4.1'
release = u'3.4.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
31 changes: 31 additions & 0 deletions doc/enterprise.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ TqSdk2 直连功能
* 减少了交易服务器依赖,程序运行稳定性提升


.. _tqjees:

TqSdk2 连接资管平台功能
-------------------------------------------------
TqSdk2 提供了资管平台的对接支持,支持用户连接到指定资管平台

以连接杰宜斯的模拟服务器为例::

from tqsdk2 import TqApi, TqAuth, TqJees

acc = TqJees(td_url="tcp://129.211.138.170:10001", broker_id="JeesDemo", app_id="shinny_tqsdk_01", auth_code= "0000000000000000", user_name="杰宜斯模拟账户", password="杰宜斯模拟账户密码")
api = TqApi(acc,auth= TqAuth("信易账户","账户密码"))

其中杰宜斯的 **模拟账户** 和 **模拟账户密码** 需要自行和杰宜斯联系获取,其他参数在杰宜斯模拟下为

td_url="tcp://39.101.174.218:40205"

broker_id="JeesDemo"

app_id="shinny_tqsdk_01"

auth_code="0000000000000000"

杰宜斯实盘情况下将对应信息换成实盘信息即可

资管平台连接模式的详细介绍,请点击 :py:class:`~tqsdk2.api.TqJees` .


.. _tqrohon:

TqSdk2 连接资管平台功能
Expand All @@ -34,8 +62,11 @@ TqSdk2 提供了资管平台的对接支持,支持用户连接到指定资管
其中融航模拟的 **模拟账户** 和 **模拟账户密码** 需要自行和融航联系获取,其他参数在融航模拟下为

td_url="tcp://129.211.138.170:10001"

broker_id="RohonDemo"

app_id="shinny_tqsdk_01"

auth_code="qZWmA7iTXaEO2w40"

融航实盘情况下将对应信息换成实盘信息即可
Expand Down
2 changes: 1 addition & 1 deletion doc/qa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
* 提出待解决的新问题
* 回答/讨论他人提出的问题

点击进入 `用户论坛 <https://www.shinnytech.com/qa>`_ ,加入讨论.
点击进入 `用户论坛 <https://forum.shinnytech.com/>`_ ,加入讨论.

.. figure:: images/qa_pic.png
2 changes: 1 addition & 1 deletion doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ klines是一个pandas.DataFrame对象. 跟 api.get_quote() 一样, api.get_kline

模拟交易和论坛
-------------------------------------------------
如果您需要使用能保存账户资金及持仓信息的模拟交易功能, 请点击 `注册信易账号 <https://www.shinnytech.com/register-intro/>`_ ,填写完对应信息之后,并验证成功即可进入 `用户论坛 <https://www.shinnytech.com/qa>`_ .
如果您需要使用能保存账户资金及持仓信息的模拟交易功能, 请点击 `注册信易账号 <https://www.shinnytech.com/register-intro/>`_ ,填写完对应信息之后,并验证成功即可进入 `用户论坛 <https://forum.shinnytech.com/>`_ .

.. figure:: images/tq_register.png

Expand Down
6 changes: 6 additions & 0 deletions doc/version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

版本变更
=============================
3.4.2 (2023/05/17)

* api:某些 pandas 版本下,web_gui 不更新绘制序列
* docs:修改论坛地址,增加支持杰宜斯的说明


3.4.1 (2023/04/24)

* 修复: 回测时,部分情况下 expired 字段错误
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='tqsdk',
version="3.4.1",
version="3.4.2",
description='TianQin SDK',
author='TianQin',
author_email='[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion tqsdk/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.4.1'
__version__ = '3.4.2'
11 changes: 8 additions & 3 deletions tqsdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3310,6 +3310,7 @@ def _init_serial(self, root_list, width, default, adj_type):
columns = ["datetime"] + default_keys
for i in range(1, len(root_list)):
columns += [k + str(i) for k in default_keys]
default_attr = set(columns) | {"symbol" + str(i) for i in range(1, len(root_list))} | {"symbol", "duration"}
serial = {
"root": root_list,
"width": width,
Expand All @@ -3319,7 +3320,8 @@ def _init_serial(self, root_list, width, default, adj_type):
"adj_type": adj_type,
"calc_ids_F": [], # 前复权已经计算过的id,每个 id 只计算一次
"update_row": 0, # 起始更新数据行
"all_attr": set(columns) | {"symbol" + str(i) for i in range(1, len(root_list))} | {"symbol", "duration"},
"default_attr": default_attr,
"all_attr": default_attr,
"extra_array": {},
}
columns = Index(columns)
Expand Down Expand Up @@ -3526,8 +3528,11 @@ def _update_serial_multi(self, serial):
array[-1, 1] + 1) # array[-1, 1] + 1: 保持左闭右开规范

def _process_serial_extra_array(self, serial):
for col in set(serial["df"].columns.values) - serial["all_attr"]:
serial["update_row"] = 0
for col in set(serial["df"].columns.values) - serial["default_attr"]:
if col not in serial["all_attr"]:
serial["update_row"] = 0 # 只有在第一次添加某个列时,才会赋值为 0。
# klines["ma_MAIN"] = ma.ma 不是在原来的序列上原地修改,而是返回一个新的序列,
# 所以这里 serial["extra_array"] 中的列每次需要重新赋值。
serial["extra_array"][col] = serial["df"][col].to_numpy()
# 如果策略中删除了之前添加到 df 中的序列,则 extra_array 中也将其删除
for col in serial["all_attr"] - set(serial["df"].columns.values):
Expand Down

0 comments on commit 69c88fb

Please sign in to comment.