Skip to content

Commit b083a6c

Browse files
committed
quote添加字段product_id
1 parent 5402ca3 commit b083a6c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

tqsdk/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ def _fetch_symbol_info(self, url):
12481248
"delivery_month": v.get("delivery_month"),
12491249
"delivery_year": v.get("delivery_year"),
12501250
"option_class": v.get("option_class", ""),
1251+
"product_id": v.get("product_id", ""),
12511252
} for k, v in rsp.json().items()
12521253
}
12531254

tqsdk/backtest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ async def _send_snapshot(self):
171171
"expire_datetime": quote.get("expire_datetime"),
172172
"delivery_month": quote.get("delivery_month"),
173173
"delivery_year": quote.get("delivery_year"),
174-
"option_class": quote.get("option_class"),
174+
"option_class": quote.get("option_class", ""),
175+
"product_id": quote.get("product_id", ""),
175176
}
176177
self._diffs.append({
177178
"quotes": quotes,

tqsdk/objs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def __init__(self, api):
149149
self.delivery_year = 0
150150
#: 期权方向
151151
self.option_class = ""
152+
#: 合约id
153+
self.product_id = ""
152154

153155
def _instance_entity(self, path):
154156
super(Quote, self)._instance_entity(path)

0 commit comments

Comments
 (0)