Skip to content

Commit 1d2496c

Browse files
committed
Merge branch 'master' into feat_mcp
2 parents cea1a92 + e09ba05 commit 1d2496c

File tree

13 files changed

+149
-73
lines changed

13 files changed

+149
-73
lines changed

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1+
## 3.4.0 (2025-06-17)
2+
### New
3+
- `QuoteClient.get_bars` 增加 `date` 参数,用于查询历史分钟K线
4+
- 一部分接口增加 `lang` 参数,支持指定语言
5+
### Mod
6+
- `TigerOpenClientConfig` 配置里默认语言改为英文
7+
8+
## 3.3.9 (2025-06-12)
9+
### New
10+
- 订单回调增加属性 `timeInForce`
11+
12+
## 3.3.8 (2025-05-29)
13+
### New
14+
- 支持 TBUS 牌照配置
15+
- 支持订单预览
16+
17+
## 3.3.7 (2025-05-12)
18+
### New
19+
- 订单回调添加属性 `attrList`
20+
- `QuoteClient` 各订阅方法返回订阅id
21+
122
## 3.3.6 (2025-04-28)
223
### New
324
- `TradeClient.get_fund_details` 资金明细
425
- `QuoteClient` 期权相关接口支持时区参数
526
### Mod
6-
= 废弃 sandbox_config 配置
27+
- 废弃 sandbox_config 配置
728

829
## 3.3.5 (2025-04-11)
930
### New

tigeropen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
55
@author: gaoan
66
"""
7-
__VERSION__ = '3.3.6'
7+
__VERSION__ = '3.4.0'

tigeropen/common/consts/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ class OrderType(Enum):
211211
class License(Enum):
212212
TBNZ = 'TBNZ'
213213
TBSG = 'TBSG'
214+
TBHK = 'TBHK'
215+
TBAU = 'TBAU'
216+
TBUS = 'TBUS'
214217

215218

216219
@unique

tigeropen/examples/quote_client_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
filemode='a', )
2626
logger = logging.getLogger('TigerOpenApi')
2727

28-
client_config = get_client_config()
29-
openapi_client = QuoteClient(client_config, logger=logger)
28+
_demo_config = get_client_config()
29+
openapi_client = QuoteClient(_demo_config, logger=logger)
3030

3131

3232
def get_quote():

tigeropen/examples/trade_client_demo.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
filemode='a', )
2828
logger = logging.getLogger('TigerOpenApi')
2929

30-
client_config = get_client_config(private_key_path='your private key file path',
31-
tiger_id='your tiger id',
32-
account='your account')
30+
_demo_config = get_client_config(private_key_path='your private key file path',
31+
tiger_id='your tiger id',
32+
account='your account')
3333

3434

3535
def get_contract_apis():
36-
openapi_client = TradeClient(client_config, logger=logger)
36+
openapi_client = TradeClient(_demo_config, logger=logger)
3737
contract = openapi_client.get_contracts('AAPL')[0]
3838
print(contract)
3939
contract = openapi_client.get_contract('AAPL', SecurityType.STK, currency=Currency.USD)
@@ -43,7 +43,7 @@ def get_contract_apis():
4343
print(contracts)
4444

4545
def get_account_apis():
46-
openapi_client = TradeClient(client_config, logger=logger)
46+
openapi_client = TradeClient(_demo_config, logger=logger)
4747
openapi_client.get_managed_accounts()
4848
# 获取订单
4949
openapi_client.get_orders()
@@ -73,7 +73,7 @@ def get_account_apis():
7373

7474
def test_get_orders_by_page():
7575
"""分页获取订单"""
76-
trade_client = TradeClient(client_config)
76+
trade_client = TradeClient(_demo_config)
7777
result = list()
7878
# 每次返回数量(需 <= 300)
7979
limit = 300
@@ -96,8 +96,8 @@ def test_get_orders_by_page():
9696

9797

9898
def trade_apis():
99-
account = client_config.account
100-
openapi_client = TradeClient(client_config, logger=logger)
99+
account = _demo_config.account
100+
openapi_client = TradeClient(_demo_config, logger=logger)
101101

102102
# 通过请求获取合约
103103
contract = openapi_client.get_contracts('AAPL')[0]
@@ -159,8 +159,8 @@ def trade_apis():
159159

160160

161161
def algo_order_demo():
162-
account = client_config.account
163-
openapi_client = TradeClient(client_config, logger=logger)
162+
account = _demo_config.account
163+
openapi_client = TradeClient(_demo_config, logger=logger)
164164
contract = stock_contract(symbol='AAPL', currency='USD')
165165
params = algo_order_params(start_time=1686147201000, end_time=1686150801000, no_take_liq=True,
166166
allow_past_end_time=True, participation_rate=0.1)
@@ -175,9 +175,9 @@ def get_account_info():
175175
:return:
176176
"""
177177
from tigeropen.common.consts.service_types import ACCOUNTS
178-
openapi_client = TigerOpenClient(client_config)
178+
openapi_client = TigerOpenClient(_demo_config)
179179
account = AccountsParams()
180-
account.account = client_config.account
180+
account.account = _demo_config.account
181181
request = OpenApiRequest(method=ACCOUNTS, biz_model=account)
182182

183183
response_content = None
@@ -197,7 +197,7 @@ def get_account_info():
197197

198198

199199
class TestTradeClient(unittest.TestCase):
200-
trade_client = TradeClient(client_config)
200+
trade_client = TradeClient(_demo_config)
201201

202202
def test_transfer_segment_fund(self):
203203
"""资金划转"""

tigeropen/push/pb/OrderStatusData.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ message OrderStatusData {
4646
double totalCashAmount = 39;
4747
double filledCashAmount = 40;
4848
double gst = 41;
49+
repeated string attrList = 42;
50+
string timeInForce = 43;
4951
}

tigeropen/push/pb/OrderStatusData_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tigeropen/push/pb/OrderStatusData_pb2.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
from google.protobuf.internal import containers as _containers
12
from google.protobuf import descriptor as _descriptor
23
from google.protobuf import message as _message
3-
from typing import ClassVar as _ClassVar, Optional as _Optional
4+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Optional as _Optional
45

56
DESCRIPTOR: _descriptor.FileDescriptor
67

78
class OrderStatusData(_message.Message):
8-
__slots__ = ("id", "account", "symbol", "expiry", "strike", "right", "identifier", "multiplier", "action", "market", "currency", "segType", "secType", "orderType", "isLong", "totalQuantity", "totalQuantityScale", "filledQuantity", "filledQuantityScale", "avgFillPrice", "limitPrice", "stopPrice", "realizedPnl", "status", "replaceStatus", "cancelStatus", "outsideRth", "canModify", "canCancel", "liquidation", "name", "source", "errorMsg", "attrDesc", "commissionAndFee", "openTime", "timestamp", "userMark", "totalCashAmount", "filledCashAmount", "gst")
9+
__slots__ = ("id", "account", "symbol", "expiry", "strike", "right", "identifier", "multiplier", "action", "market", "currency", "segType", "secType", "orderType", "isLong", "totalQuantity", "totalQuantityScale", "filledQuantity", "filledQuantityScale", "avgFillPrice", "limitPrice", "stopPrice", "realizedPnl", "status", "replaceStatus", "cancelStatus", "outsideRth", "canModify", "canCancel", "liquidation", "name", "source", "errorMsg", "attrDesc", "commissionAndFee", "openTime", "timestamp", "userMark", "totalCashAmount", "filledCashAmount", "gst", "attrList", "timeInForce")
910
ID_FIELD_NUMBER: _ClassVar[int]
1011
ACCOUNT_FIELD_NUMBER: _ClassVar[int]
1112
SYMBOL_FIELD_NUMBER: _ClassVar[int]
@@ -47,6 +48,8 @@ class OrderStatusData(_message.Message):
4748
TOTALCASHAMOUNT_FIELD_NUMBER: _ClassVar[int]
4849
FILLEDCASHAMOUNT_FIELD_NUMBER: _ClassVar[int]
4950
GST_FIELD_NUMBER: _ClassVar[int]
51+
ATTRLIST_FIELD_NUMBER: _ClassVar[int]
52+
TIMEINFORCE_FIELD_NUMBER: _ClassVar[int]
5053
id: int
5154
account: str
5255
symbol: str
@@ -88,4 +91,6 @@ class OrderStatusData(_message.Message):
8891
totalCashAmount: float
8992
filledCashAmount: float
9093
gst: float
91-
def __init__(self, id: _Optional[int] = ..., account: _Optional[str] = ..., symbol: _Optional[str] = ..., expiry: _Optional[str] = ..., strike: _Optional[str] = ..., right: _Optional[str] = ..., identifier: _Optional[str] = ..., multiplier: _Optional[int] = ..., action: _Optional[str] = ..., market: _Optional[str] = ..., currency: _Optional[str] = ..., segType: _Optional[str] = ..., secType: _Optional[str] = ..., orderType: _Optional[str] = ..., isLong: bool = ..., totalQuantity: _Optional[int] = ..., totalQuantityScale: _Optional[int] = ..., filledQuantity: _Optional[int] = ..., filledQuantityScale: _Optional[int] = ..., avgFillPrice: _Optional[float] = ..., limitPrice: _Optional[float] = ..., stopPrice: _Optional[float] = ..., realizedPnl: _Optional[float] = ..., status: _Optional[str] = ..., replaceStatus: _Optional[str] = ..., cancelStatus: _Optional[str] = ..., outsideRth: bool = ..., canModify: bool = ..., canCancel: bool = ..., liquidation: bool = ..., name: _Optional[str] = ..., source: _Optional[str] = ..., errorMsg: _Optional[str] = ..., attrDesc: _Optional[str] = ..., commissionAndFee: _Optional[float] = ..., openTime: _Optional[int] = ..., timestamp: _Optional[int] = ..., userMark: _Optional[str] = ..., totalCashAmount: _Optional[float] = ..., filledCashAmount: _Optional[float] = ..., gst: _Optional[float] = ...) -> None: ...
94+
attrList: _containers.RepeatedScalarFieldContainer[str]
95+
timeInForce: str
96+
def __init__(self, id: _Optional[int] = ..., account: _Optional[str] = ..., symbol: _Optional[str] = ..., expiry: _Optional[str] = ..., strike: _Optional[str] = ..., right: _Optional[str] = ..., identifier: _Optional[str] = ..., multiplier: _Optional[int] = ..., action: _Optional[str] = ..., market: _Optional[str] = ..., currency: _Optional[str] = ..., segType: _Optional[str] = ..., secType: _Optional[str] = ..., orderType: _Optional[str] = ..., isLong: bool = ..., totalQuantity: _Optional[int] = ..., totalQuantityScale: _Optional[int] = ..., filledQuantity: _Optional[int] = ..., filledQuantityScale: _Optional[int] = ..., avgFillPrice: _Optional[float] = ..., limitPrice: _Optional[float] = ..., stopPrice: _Optional[float] = ..., realizedPnl: _Optional[float] = ..., status: _Optional[str] = ..., replaceStatus: _Optional[str] = ..., cancelStatus: _Optional[str] = ..., outsideRth: bool = ..., canModify: bool = ..., canCancel: bool = ..., liquidation: bool = ..., name: _Optional[str] = ..., source: _Optional[str] = ..., errorMsg: _Optional[str] = ..., attrDesc: _Optional[str] = ..., commissionAndFee: _Optional[float] = ..., openTime: _Optional[int] = ..., timestamp: _Optional[int] = ..., userMark: _Optional[str] = ..., totalCashAmount: _Optional[float] = ..., filledCashAmount: _Optional[float] = ..., gst: _Optional[float] = ..., attrList: _Optional[_Iterable[str]] = ..., timeInForce: _Optional[str] = ...) -> None: ...

0 commit comments

Comments
 (0)