|
12 | 12 |
|
13 | 13 | from tigeropen.common.consts import Market, Language, QuoteRight, BarPeriod, OPEN_API_SERVICE_VERSION_V3 |
14 | 14 | from tigeropen.common.consts import THREAD_LOCAL, SecurityType, CorporateActionType, IndustryLevel |
15 | | -from tigeropen.common.consts.service_types import GRAB_QUOTE_PERMISSION, STOCK_SCREENER |
| 15 | +from tigeropen.common.consts.service_types import GRAB_QUOTE_PERMISSION, QUOTE_DELAY, STOCK_SCREENER |
16 | 16 | from tigeropen.common.consts.service_types import MARKET_STATE, ALL_SYMBOLS, ALL_SYMBOL_NAMES, BRIEF, \ |
17 | 17 | TIMELINE, KLINE, TRADE_TICK, OPTION_EXPIRATION, OPTION_CHAIN, FUTURE_EXCHANGE, OPTION_BRIEF, \ |
18 | 18 | OPTION_KLINE, OPTION_TRADE_TICK, FUTURE_KLINE, FUTURE_TICK, FUTURE_CONTRACT_BY_EXCHANGE_CODE, \ |
|
50 | 50 | from tigeropen.quote.response.option_quote_ticks_response import OptionTradeTickResponse |
51 | 51 | from tigeropen.quote.response.quote_bar_response import QuoteBarResponse |
52 | 52 | from tigeropen.quote.response.quote_brief_response import QuoteBriefResponse |
| 53 | +from tigeropen.quote.response.quote_delay_briefs_response import DelayBriefsResponse |
53 | 54 | from tigeropen.quote.response.quote_depth_response import DepthQuoteResponse |
54 | 55 | from tigeropen.quote.response.quote_grab_permission_response import QuoteGrabPermissionResponse |
55 | 56 | from tigeropen.quote.response.quote_ticks_response import TradeTickResponse |
@@ -248,6 +249,38 @@ def get_stock_briefs(self, symbols, lang=None): |
248 | 249 |
|
249 | 250 | return None |
250 | 251 |
|
| 252 | + def get_stock_delay_briefs(self, symbols, lang=None): |
| 253 | + """ |
| 254 | + query delay quote |
| 255 | + :param symbols: stock symbol list, like ['AAPL', 'GOOG'] |
| 256 | + :param lang: language: tigeropen.common.consts.Language: zh_CN,zh_TW,en_US |
| 257 | + :return: pandas.DataFrame. the columns are as follows: |
| 258 | + symbol: |
| 259 | + pre_close: |
| 260 | + time: last quote change time |
| 261 | + volume: |
| 262 | + open: |
| 263 | + high: |
| 264 | + low: |
| 265 | + close: |
| 266 | + halted: stock status(0: normal 3: suspended 4: delist 7: ipo 8: changed) |
| 267 | + """ |
| 268 | + params = MultipleQuoteParams() |
| 269 | + params.symbols = symbols |
| 270 | + params.lang = lang.value if lang else self._lang.value |
| 271 | + |
| 272 | + request = OpenApiRequest(QUOTE_DELAY, biz_model=params) |
| 273 | + response_content = self.__fetch_data(request) |
| 274 | + if response_content: |
| 275 | + response = DelayBriefsResponse() |
| 276 | + response.parse_response_content(response_content) |
| 277 | + if response.is_success(): |
| 278 | + return response.briefs |
| 279 | + else: |
| 280 | + raise ApiException(response.code, response.message) |
| 281 | + |
| 282 | + return None |
| 283 | + |
251 | 284 | def get_stock_details(self, symbols, lang=None): |
252 | 285 | """ |
253 | 286 | 获取股票详情 |
|
0 commit comments