ContextInfo.get_stock_name - 根据代码获取名称

ContextInfo.get_stock_name 是 QMT 内置 Python 中用于根据代码获取名称的接口。

原型

ContextInfo.get_stock_name('stockcode')

释义

ContextInfo.get_stock_name 是 QMT 内置 Python 中用于根据代码获取名称的接口。

研究:官方目录未明确;回测:官方目录未明确;模拟:官方目录未明确;实盘:官方目录未明确。

参数

参数 是否必填 官方原始定义
'stockcode' 'stockcode'

返回值

以实际接口返回和下方详细说明为准。

示例

示例返回值

def handlebar(ContextInfo):

print(ContextInfo.get_stock_name('000001.SZ'))

详细说明

注意事项

我们计划后续版本抛弃这个函数,不建议继续使用,可以用ContextInfo.get_instrument_detail("stockcode")["InstrumentName"]来实现同样功能

用法: ContextInfo.get_stock_name('stockcode')

释义: 根据代码获取名称

参数: stockcode:股票代码,如'000001.SZ',缺省值 ' ' 默认为当前图代码

返回: string(GBK编码)