在python引用中这样写:
close = pel_history_bars( 3+1,'close')
refclose = close[-2:-1].sum() /1
closelen=len(close)
context.refclose=refclose
context.closelen=closelen
在PEL中这样写:closelen:GETPYTHONVAL('closelen');
refclose:GETPYTHONVAL('refclose');
都能正常显示,读出来的CLOSE长度除了上市的头几天会显示0、2、3、4、4、4、4。。。。。
也能读出refclose 最多就是上市的第一天显示为0,随后都能读出来,但是如果把那句refclose = close[-2:-1].sum() /1 改成refclose = close[-2],就还是提示出现顶楼那种错误
谢谢,解决了,
close = pel_history_bars( 3+1,'close') 这句话要用在一只股票所有的Bar里,当它遇到LEN(close)长度不够长的情况下,就会报错,不管你是否把光标移动到上市的头几天 。