|
15 | 15 | from tigeropen.common.consts import THREAD_LOCAL, SecurityType, CorporateActionType, IndustryLevel |
16 | 16 | from tigeropen.common.consts.filter_fields import FieldBelongType |
17 | 17 | from tigeropen.common.consts.service_types import GRAB_QUOTE_PERMISSION, QUOTE_DELAY, GET_QUOTE_PERMISSION, \ |
18 | | - HISTORY_TIMELINE, FUTURE_CONTRACT_BY_CONTRACT_CODE, TRADING_CALENDAR, FUTURE_CONTRACTS, MARKET_SCANNER |
| 18 | + HISTORY_TIMELINE, FUTURE_CONTRACT_BY_CONTRACT_CODE, TRADING_CALENDAR, FUTURE_CONTRACTS, MARKET_SCANNER, STOCK_BROKER |
19 | 19 | from tigeropen.common.consts.service_types import MARKET_STATE, ALL_SYMBOLS, ALL_SYMBOL_NAMES, BRIEF, \ |
20 | 20 | TIMELINE, KLINE, TRADE_TICK, OPTION_EXPIRATION, OPTION_CHAIN, FUTURE_EXCHANGE, OPTION_BRIEF, \ |
21 | 21 | OPTION_KLINE, OPTION_TRADE_TICK, FUTURE_KLINE, FUTURE_TICK, FUTURE_CONTRACT_BY_EXCHANGE_CODE, \ |
|
38 | 38 | from tigeropen.quote.domain.filter import OptionFilter |
39 | 39 | from tigeropen.quote.request.model import MarketParams, MultipleQuoteParams, MultipleContractParams, \ |
40 | 40 | FutureQuoteParams, FutureExchangeParams, FutureContractParams, FutureTradingTimeParams, SingleContractParams, \ |
41 | | - SingleOptionQuoteParams, DepthQuoteParams, OptionChainParams, TradingCalendarParams, MarketScannerParams |
| 41 | + SingleOptionQuoteParams, DepthQuoteParams, OptionChainParams, TradingCalendarParams, MarketScannerParams, \ |
| 42 | + StockBrokerParams |
42 | 43 | from tigeropen.quote.response.future_briefs_response import FutureBriefsResponse |
43 | 44 | from tigeropen.quote.response.future_contract_response import FutureContractResponse |
44 | 45 | from tigeropen.quote.response.future_exchange_response import FutureExchangeResponse |
|
61 | 62 | from tigeropen.quote.response.quote_timeline_response import QuoteTimelineResponse |
62 | 63 | from tigeropen.quote.response.market_scanner_response import MarketScannerResponse |
63 | 64 | from tigeropen.quote.response.stock_briefs_response import StockBriefsResponse |
| 65 | +from tigeropen.quote.response.stock_broker_response import StockBrokerResponse |
64 | 66 | from tigeropen.quote.response.stock_details_response import StockDetailsResponse |
65 | 67 | from tigeropen.quote.response.stock_short_interest_response import ShortInterestResponse |
66 | 68 | from tigeropen.quote.response.stock_trade_meta_response import TradeMetaResponse |
@@ -1454,3 +1456,24 @@ def get_trading_calendar(self, market, begin_date=None, end_date=None): |
1454 | 1456 | else: |
1455 | 1457 | raise ApiException(response.code, response.message) |
1456 | 1458 | return False |
| 1459 | + |
| 1460 | + def get_stock_broker(self, symbol, limit=40, lang=None): |
| 1461 | + """Get stock broker information |
| 1462 | + :param symbol: |
| 1463 | + :param limit: The maximum number of items returned. Default value is 40. |
| 1464 | + :param lang: tigeropen.common.consts.Language |
| 1465 | + """ |
| 1466 | + params = StockBrokerParams() |
| 1467 | + params.symbol = symbol |
| 1468 | + params.limit = limit |
| 1469 | + params.lang = get_enum_value(lang) if lang else get_enum_value(self._lang) |
| 1470 | + request = OpenApiRequest(STOCK_BROKER, biz_model=params) |
| 1471 | + response_content = self.__fetch_data(request) |
| 1472 | + if response_content: |
| 1473 | + response = StockBrokerResponse() |
| 1474 | + response.parse_response_content(response_content) |
| 1475 | + if response.is_success(): |
| 1476 | + return response.result |
| 1477 | + else: |
| 1478 | + raise ApiException(response.code, response.message) |
| 1479 | + return False |
0 commit comments