Skip to content

Commit

Permalink
Update Version 3.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
shinny-pack authored and shinny-mayanqiong committed Aug 29, 2023
1 parent a9726de commit 2a2f55d
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 8 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.6
Version: 3.4.7
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.6'
version = u'3.4.7'
# The full version, including alpha/beta/rc tags.
release = u'3.4.6'
release = u'3.4.7'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
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.7 (2023/08/29)

* 修复::py:class:`~tqsdk.TargetPosTask` 及 :py:class:`~tqsdk.algorithm.twap` 添加纯碱期货 2309 合约及 2310 合约暂不支持的提示
* docs:完善 :py:class:`~tqsdk.TqKq` 快期模拟辅模拟账户使用说明


3.4.6 (2023/08/11)

* 增加:支持同时使用多个快期模拟账户,:py:class:`~tqsdk.TqKq`、:py:class:`~tqsdk.TqKqStock` 加入多帐号支持
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.6",
version="3.4.7",
description='TianQin SDK',
author='TianQin',
author_email='tianqincn@gmail.com',
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.6'
__version__ = '3.4.7'
2 changes: 2 additions & 0 deletions tqsdk/algorithm/twap.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def __init__(self, api: TqApi, symbol: str, direction: str, offset: str, volume:
raise Exception("粳稻期货不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 10 手,这些函数还未支持该规则!")
if symbol.startswith("CZCE.LR"):
raise Exception("晚籼稻期货不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 10 手,这些函数还未支持该规则!")
if symbol == "CZCE.SA309" or symbol == "CZCE.SA310":
raise Exception("纯碱期货 2309 合约及 2310 合约不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 4 手,这些函数还未支持该规则!")
self._api = api
self._account = api._account._check_valid(account)
if self._account is None:
Expand Down
2 changes: 2 additions & 0 deletions tqsdk/lib/target_pos_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def get_price(direction):
raise Exception("粳稻期货不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 10 手,这些函数还未支持该规则!")
if symbol.startswith("CZCE.LR"):
raise Exception("晚籼稻期货不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 10 手,这些函数还未支持该规则!")
if symbol == "CZCE.SA309" or symbol == "CZCE.SA310":
raise Exception("纯碱期货 2309 合约及 2310 合约不支持创建 targetpostask、twap、vwap 任务,交易所规定该品种最小开仓手数为大于等于 4 手,这些函数还未支持该规则!")
super(TargetPosTask, self).__init__()
self._api = api
self._account = api._account._check_valid(account)
Expand Down
23 changes: 20 additions & 3 deletions tqsdk/tradeable/otg/tqkq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- coding:utf-8 -*-
__author__ = 'yanqiong'


from typing import Optional

from tqsdk.tradeable.otg.base_otg import BaseOtg
Expand All @@ -21,9 +20,9 @@ def __init__(self, td_url: Optional[str] = None, number: Optional[int] = None):
Args:
td_url (str): [可选]指定交易服务器的地址, 默认使用快期账户对应的交易服务地址
number (int): [可选]模拟交易账号编号, 默认为主模拟账号, 可以通过指定 1~99 的数字来使用辅模拟帐号, 各个帐号的数据完全独立
number (int): [可选]模拟交易账号编号, 默认为主模拟账号, 可以通过指定 1~99 的数字来使用辅模拟帐号, 各个帐号的数据完全独立, 使用该功能需要购买专业版的权限, 且对应的辅账户可以在快期专业版上登录并进行观察
Example::
Example1::
from tqsdk import TqApi, TqAuth, TqKq
Expand All @@ -45,6 +44,24 @@ def __init__(self, td_url: Optional[str] = None, number: Optional[int] = None):
print(trade) # 打印委托单对应的成交信息
api.close()
Example2::
from tqsdk import TqApi, TqAuth, TqKq, TqMultiAccount
# 创建快期模拟账户和辅模拟账户001
tq_kq = TqKq()
tq_kq001= TqKq(number=1)
# 使用多账户模块同时登录这两个模拟账户
api = TqApi(account=TqMultiAccount([tq_kq,tq_kq001]), auth=TqAuth("快期账户", "账户密码"))
print(tq_kq.get_account()) # 打印快期模拟账户信息
print(tq_kq001.get_account()) # 打印快期模拟001账户信息
api.close()
"""
super().__init__("快期模拟", "", "", td_url=td_url)
self._account_no = number
Expand Down

0 comments on commit 2a2f55d

Please sign in to comment.