可转债回测出错


(sdzjx) #1

instruments = [‘110059.SHA’]

开始时间

start_date = ‘2019-01-29’

结束时间

end_date = ‘2020-08-18’
k = instruments[0] # 标的为字符串格式
sid = context.symbol(k) #

context.symbol(k)这句出错了,

提示
SymbolNotFound Traceback (most recent call last)
in ()
6 end_date = ‘2020-08-18’
7 k = instruments[0] # 标的为字符串格式
----> 8 sid = context.symbol(k) # 将标的转化为equity格式

SymbolNotFound: Symbol ‘110059.SHA’ was not found.
难道不支持可转债???


(iQuant) #2

支持的,需要以自定义的方式进行回测,可参考基金回测样例。