各位大佬,关于 Get_price参数中的时间参数,是否可以放一个变量呢?现在总是失败,想在脚本中获取当前回测时候的时间填入,然后通过 Get_price函数获取当天的开盘价,然后判断是否大于5日均线。一直报错。
date = get_datetime().strftime('%Y%m%d')
CurValue = get_price(securities='601668.SH',end_date=date,fre_step='1d',fields = ['open'],skip_paused=True,fq = 'pre',bar_count = 251,is_panel=1)
总是失败,使用 history 函数只能获得回测当天以前的内容,当天的获取不到,还请不吝赐教。谢谢!