#筛选非停牌且eps大于0的票
for i in context.code:
close = history_bars(i, 1, '1d','close')
temp = fin_indicator(i,'EPS',1,0,0)
if len(close)>0 and temp[-1]>0:
code.append(i)
#转换成市盈率
for j in code:
close = history_bars(j, 1, '1d','close')
temp = fin_indicator(j,'EPS',1,0,0)
pe.append(close[-1]/temp[-1])
pe_ra = np.array(pe)
#对pe进行排序,buy_list是排名前几的股票列表
sort = np.argsort(pe_ra)
code = np.array(code)
buy_list = code[[sort[:context.num]]]
sell_num = 0
历史数据和深度财务数据是否有补充,如果没有数据那么是测不到的。另外代码里你可以加入一些print看下筛选非停牌且eps大于0的票这个动作后的code列表是有哪些品种