sector - 板块股票列表
rqalpha.api.
sector
(code)[源代码]- 获得属于某一板块的所有股票列表。
参数:code – 板块名称或板块代码。例如,能源板块可填写’Energy’、’能源’或sectorcode.Energy:type code: _str | sector_code返回:list of order_book_id 属于该板块的股票列表
目前支持的板块分类如下,其取值参考自MSCI发布的全球行业标准分类:
板块代码中文板块名称英文板块名称Energy能源energyMaterials原材料materialsConsumerDiscretionary非必需消费品consumer discretionaryConsumerStaples必需消费品consumer staplesHealthCare医疗保健health careFinancials金融financialsInformationTechnology信息技术information technologyTelecommunicationServices电信服务telecommunication servicesUtilities公共服务utilitiesIndustrials工业industrials
Example:
- def init(context):
- ids1 = sector("consumer discretionary")
- ids2 = sector("非必需消费品")
- ids3 = sector("ConsumerDiscretionary")
- assert ids1 == ids2 and ids1 == ids3
- logger.info(ids1)
- #INIT INFO
- #['002045.XSHE', '603099.XSHG', '002486.XSHE', '002536.XSHE', '300100.XSHE', '600633.XSHG', '002291.XSHE', ..., '600233.XSHG']