QMT · 内置 Python系统函数
ContextInfo.get_stock_name
根据代码获取名称
注意
我们计划后续版本抛弃这个函数,不建议继续使用,可以用ContextInfo.get_instrument_detail("stockcode")["InstrumentName"]来实现同样功能
用法
ContextInfo.get_stock_name('stockcode')
释义
根据代码获取名称
参数
stockcode:股票代码,如'000001.SZ',缺省值 ' ' 默认为当前图代码
返回值
string(GBK编码)
示例
示例
def handlebar(ContextInfo):
print(ContextInfo.get_stock_name('000001.SZ'))
返回值
平安银行
官方来源
QMT 官方文档:根据代码获取名称。网页核对日期:2026-10-11。