?
?來源: CXH99.COM
?#篩選非停牌且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列表是有哪些品種
?