Skip to content

Commit d079e08

Browse files
committed
modify contract field
1 parent 439153c commit d079e08

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tigeropen/trade/domain/contract.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self, symbol, currency, contract_id=None, sec_type=None, exchange=N
2727
self.strike = strike
2828
# 看跌/看涨
2929
self.put_call = put_call
30+
self.right = self.put_call
3031
# 合约乘数
3132
self.multiplier = multiplier
3233
# 合约名称

tigeropen/trade/trade_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get_contracts(self, symbol, sec_type=SecurityType.STK, currency=None, exchan
9696
return None
9797

9898
def get_contract(self, symbol, sec_type=SecurityType.STK, currency=None, exchange=None, expiry=None, strike=None,
99-
right=None):
99+
put_call=None):
100100
"""
101101
获取合约
102102
:param symbol:
@@ -105,7 +105,7 @@ def get_contract(self, symbol, sec_type=SecurityType.STK, currency=None, exchang
105105
:param exchange: 交易所
106106
:param expiry: 合约到期日(期货/期权) yyyyMMdd
107107
:param strike: 行权价(期权)
108-
:param right: CALL/PUT
108+
:param put_call: CALL/PUT
109109
:return: Contract 对象. 有如下属性:
110110
symbol: 合约 symbol
111111
identifier: 合约唯一标识
@@ -136,8 +136,8 @@ def get_contract(self, symbol, sec_type=SecurityType.STK, currency=None, exchang
136136
params.expiry = expiry
137137
if strike:
138138
params.strike = strike
139-
if right:
140-
params.right = right
139+
if put_call:
140+
params.right = put_call
141141
params.exchange = exchange
142142

143143
request = OpenApiRequest(CONTRACT, biz_model=params)

0 commit comments

Comments
 (0)